:root {
  --BG_DARK: #070B13;
  --BG_MID: #0F1625;
  --BG_PANEL: #141B2B;
  --BG_INPUT: #0B111D;
  --BG_CARD: #111A2C;
  --BG_CONSOLE: #080D17;
  --BG_SIDEBAR: #0B111D;
  --BG_SIDEBAR_BUTTON: #111A2C;
  --BG_SIDEBAR_ACTIVE: #18243A;
  --FG_COLOR: #E6EDF3;
  --FG_DIM: #8794AF;
  --FG_MUTED: #A0ABC2;
  --ACCENT_PINK: #FF2D6F;
  --ACCENT_PINK_HOVER: #FF4A84;
  --ACCENT_CYAN: #1DE9FF;
  --ACCENT_CYAN_DIM: #1F8EA8;
  --ACCENT_GREEN: #2ECC71;
  --ACCENT_YELLOW: #F0C040;
  --CARD_BORDER_PINK: #8B1E56;
  --CARD_BORDER_CYAN: #197D99;
  --BORDER_COLOR: #243149;
  --BORDER_SUBTLE: #22314A;
  --BUTTON_DANGER: #A81D49;
  --BUTTON_GHOST: #171D2A;
  --BUTTON_GHOST_HOVER: #1D2638;
  --BUTTON_MUTED: #20283B;
  --TEXTURE_IMAGE: none;
  --TEXTURE_OPACITY: 1;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="day"] {
  --BG_DARK: #F4F7FB;
  --BG_MID: #FFFFFF;
  --BG_PANEL: #FFFFFF;
  --BG_INPUT: #F7F9FD;
  --BG_CARD: #EEF3F8;
  --BG_CONSOLE: #EEF3F8;
  --BG_SIDEBAR: #F7F9FD;
  --BG_SIDEBAR_BUTTON: #FFFFFF;
  --BG_SIDEBAR_ACTIVE: #E9F3F8;
  --FG_COLOR: #172033;
  --FG_DIM: #6B758A;
  --FG_MUTED: #3E4B63;
  --CARD_BORDER_PINK: #E6A2BE;
  --CARD_BORDER_CYAN: #93CAD7;
  --BORDER_COLOR: #D4DCE8;
  --BORDER_SUBTLE: #D9E2EF;
  --BUTTON_GHOST: #F6F8FC;
  --BUTTON_GHOST_HOVER: #E9EEF7;
  --BUTTON_MUTED: #E3EAF4;
  --TEXTURE_IMAGE: none;
  --TEXTURE_OPACITY: 1;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--FG_COLOR);
  background:
    radial-gradient(circle at 12% -10%, rgba(29, 233, 255, 0.13), transparent 34%),
    radial-gradient(circle at 92% 6%, rgba(255, 45, 111, 0.11), transparent 28%),
    linear-gradient(180deg, #070B13 0%, #0B111D 48%, #070B13 100%),
    var(--BG_DARK);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: -16%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(29, 233, 255, 0.06), transparent 38%),
    radial-gradient(ellipse at 78% 88%, rgba(178, 103, 255, 0.05), transparent 36%);
  opacity: calc(var(--TEXTURE_OPACITY) * 0.5);
  filter: blur(22px);
  transform: translate3d(0, 0, 0);
}

:root[data-performance="on"] body::before {
  opacity: calc(var(--TEXTURE_OPACITY) * 0.32);
  filter: blur(14px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 32%);
  background-size: 460px 100%, 100% 620px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.24) 78%, transparent 100%);
  opacity: 0.2;
}

@keyframes weverAurora {
  0% {
    transform: translate3d(-2%, -1%, 0) rotate(-1deg);
  }

  100% {
    transform: translate3d(2%, 1.5%, 0) rotate(1deg);
  }
}

button,
input,
select {
  font: inherit;
}

button,
a {
  color: inherit;
}

.workbook-shell {
  min-height: 100vh;
  padding: 12px;
}

.glass-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(166, 186, 218, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 44%, rgba(29, 233, 255, 0.035)),
    rgba(17, 26, 44, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  contain: layout paint;
}

:root[data-performance="on"] .glass-panel,
:root[data-performance="on"] .formula-bar,
:root[data-performance="on"] .sheet-nav {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

:root[data-performance="on"] .glass-panel::before {
  opacity: 0.06;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.22), transparent 24%),
    radial-gradient(circle at 92% 100%, rgba(29, 233, 255, 0.08), transparent 30%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.16), transparent 26%, transparent 70%, rgba(255, 255, 255, 0.06));
  opacity: 0.55;
}

.glass-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.glass-panel > * {
  position: relative;
  z-index: 2;
}

.app-header {
  position: sticky;
  top: 8px;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 12px;
}

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

.logo-box {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(125, 137, 166, 0.22);
  border-radius: 50%;
  background: rgba(8, 13, 23, 0.72);
}

.logo-box.large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(29, 233, 255, 0.16);
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.logo-box.large img {
  border-radius: inherit;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--ACCENT_CYAN);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header .brand-block .eyebrow {
  margin: 0 0 2px;
  color: rgba(168, 200, 240, 0.66);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.app-header .brand-block {
  gap: 16px;
}

.app-header .logo-box.large {
  width: 58px;
  height: 58px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  min-width: 210px;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--FG_MUTED);
  background: rgba(11, 17, 29, 0.76);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.status-pill[data-tone="ok"] {
  border-color: var(--CARD_BORDER_CYAN);
  color: var(--ACCENT_CYAN);
}

.status-pill[data-tone="warn"] {
  border-color: var(--ACCENT_YELLOW);
  color: var(--ACCENT_YELLOW);
}

.status-pill[data-tone="error"] {
  border-color: var(--ACCENT_PINK, #ff5f6e);
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 95, 110, 0.92), rgba(255, 64, 90, 0.92));
  box-shadow: 0 0 0 1px rgba(255, 95, 110, 0.35), 0 6px 18px rgba(255, 64, 90, 0.25);
}

.status-pill[data-tone="loading"] {
  border-color: var(--ACCENT_CYAN);
  color: var(--ACCENT_CYAN);
  background: rgba(29, 233, 255, 0.08);
  position: relative;
  overflow: hidden;
}
.status-pill[data-tone="loading"]::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(29, 233, 255, 0.32), transparent);
  animation: wbLoadingShimmer 1.4s infinite linear;
}
@keyframes wbLoadingShimmer {
  from { transform: translateX(0); }
  to   { transform: translateX(350%); }
}

/* Full-screen loading overlay — shown only on the very first load when
   there is no cached data yet, so users don't stare at an empty dashboard
   wondering if something is broken. */
.wb-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: wbOverlayFade 200ms ease-out;
}
@keyframes wbOverlayFade { from { opacity: 0; } to { opacity: 1; } }

.wb-loading-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 280px;
  padding: 26px 36px;
  background: rgba(14, 20, 34, 0.96);
  border: 1px solid rgba(166, 186, 218, 0.22);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: var(--text-primary, #eaf0fb);
  text-align: center;
}
.wb-loading-card .wb-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(29, 233, 255, 0.18);
  border-top-color: var(--ACCENT_CYAN, #1de9ff);
  animation: wbSpin 0.9s linear infinite;
}
@keyframes wbSpin { to { transform: rotate(360deg); } }
.wb-loading-card strong {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.wb-loading-card small {
  font-size: 0.74rem;
  color: rgba(216, 226, 242, 0.62);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Inline error banner — appears below the page header when the live fetch
   failed AND we couldn't fall back to recent data. More visible than a small
   pill in the top-right corner. */
.wb-error-banner {
  margin: 12px 18px 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 95, 110, 0.16), rgba(255, 64, 90, 0.08));
  border: 1px solid rgba(255, 95, 110, 0.45);
  color: var(--text-primary, #eaf0fb);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}
.wb-error-banner .wb-error-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 95, 110, 0.32);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 800;
}
.wb-error-banner button {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
}
.wb-error-banner button:hover {
  background: rgba(255, 255, 255, 0.22);
}

#refreshButton[data-busy="1"] {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
}
#refreshButton[data-busy="1"]::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  vertical-align: -1px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: wbSpin 0.7s linear infinite;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--FG_MUTED);
  background: var(--BUTTON_GHOST);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(178, 103, 255, 0.85);
}

.logout-button {
  flex: 0 0 auto;
  border-color: var(--BORDER_COLOR);
  color: var(--FG_MUTED);
  background: var(--BUTTON_GHOST);
}

.performance-toggle {
  flex: 0 0 auto;
  min-width: 148px;
  border-color: var(--BORDER_COLOR);
  color: var(--FG_MUTED);
  background: var(--BUTTON_GHOST);
  font-weight: 700;
}

.performance-toggle:hover {
  color: var(--FG_COLOR);
  background: var(--BUTTON_GHOST_HOVER);
}

.performance-toggle[aria-pressed="true"] {
  border-color: rgba(46, 204, 113, 0.32);
  color: var(--FG_COLOR);
  background: var(--BUTTON_GHOST);
}

.performance-toggle[aria-pressed="true"]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--ACCENT_GREEN);
}

button {
  min-height: 42px;
  border: 1px solid var(--CARD_BORDER_PINK);
  border-radius: 8px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--BUTTON_DANGER);
  cursor: pointer;
}

button:hover {
  background: var(--ACCENT_PINK_HOVER);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  border-color: var(--BORDER_COLOR);
  /* Brighter label so the icon and text sit above the WCAG AA contrast
     threshold on the dark header background. Was --FG_MUTED, which read as
     muted/washed-out next to the brighter Refresh / Log out buttons. */
  color: var(--FG_COLOR);
  background: var(--BUTTON_GHOST);
  font-weight: 700;
}

.app-header #refreshButton {
  border-color: var(--BORDER_COLOR);
  color: var(--FG_MUTED);
  background: var(--BUTTON_GHOST);
  font-weight: 700;
}

.app-header #refreshButton:hover {
  color: var(--FG_COLOR);
  background: var(--BUTTON_GHOST_HOVER);
}

.theme-toggle::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  background: currentColor;
  -webkit-mask: url("Graphics/sun-svgrepo-com.svg") center / contain no-repeat;
  mask: url("Graphics/sun-svgrepo-com.svg") center / contain no-repeat;
}

:root[data-theme="day"] .theme-toggle::before {
  -webkit-mask-image: url("Graphics/moon-svgrepo-com.svg");
  mask-image: url("Graphics/moon-svgrepo-com.svg");
}

.theme-toggle:hover {
  color: var(--FG_COLOR);
  background: var(--BUTTON_GHOST_HOVER);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

body[data-page="login"]::before {
  animation-duration: 20s;
  opacity: 1;
}

body[data-page="login"] .glass-panel::before {
  opacity: 0.28;
}

.login-panel {
  width: min(440px, 100%);
  padding: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035),
    0 28px 80px rgba(0, 0, 0, 0.34),
    0 0 60px rgba(29, 233, 255, 0.08);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  border: 1px solid rgba(166, 186, 218, 0.16);
  border-radius: 8px;
  background: rgba(8, 13, 23, 0.42);
}

.login-form button {
  margin-top: 4px;
}

.login-error {
  min-height: 1.1rem;
  margin: -3px 2px 0;
  color: #FF6B6B;
  font-size: 0.82rem;
  font-weight: 650;
}

.formula-bar {
  position: sticky;
  top: 88px;
  z-index: 38;
  display: grid;
  grid-template-columns: minmax(190px, 0.78fr) minmax(380px, 1.55fr) repeat(6, minmax(126px, 0.72fr)) minmax(132px, 0.62fr);
  gap: 2px;
  margin-top: 10px;
  overflow: visible;
  border-radius: 8px;
  background: rgba(24, 34, 53, 0.5);
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  contain: layout paint;
}

body[data-page="players"] .formula-bar {
  display: grid;
  flex-wrap: nowrap;
  grid-template-columns: minmax(150px, 0.62fr) minmax(260px, 1.2fr) repeat(9, minmax(96px, 0.6fr)) minmax(108px, 0.58fr);
}

.name-box,
.formula-bar label {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(8, 13, 23, 0.68);
}

.name-box {
  display: grid;
  align-items: center;
  min-height: 58px;
  padding: 0 20px;
  color: var(--FG_COLOR);
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

label {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  color: var(--FG_MUTED);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--FG_COLOR);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(11, 17, 29, 0.82);
  font-size: 0.94rem;
  font-weight: 550;
  text-transform: none;
}

input::placeholder {
  color: var(--FG_DIM);
}

.workbook-grid {
  display: grid;
  grid-template-columns: 162px minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.workbook-grid.full-log-grid {
  grid-template-columns: 132px minmax(0, 1fr);
}

.sheet-nav {
  position: sticky;
  top: 272px;
  align-self: start;
  display: grid;
  gap: 6px;
  padding: 8px;
  max-height: calc(100vh - 284px);
  overflow-y: auto;
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  contain: layout paint;
}

body[data-page="users"] .sheet-nav {
  top: 88px;
  max-height: calc(100vh - 100px);
}

.filter-clear {
  align-self: stretch;
  min-width: 0;
  margin: 0;
  border-color: var(--BORDER_COLOR);
  border-radius: 0;
  color: var(--FG_MUTED);
  background: var(--BUTTON_GHOST);
  font-weight: 700;
}

.filter-clear:hover {
  color: var(--FG_COLOR);
  background: var(--BUTTON_GHOST_HOVER);
}

.date-availability {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 38px;
  padding: 6px 10px;
  overflow-x: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(8, 13, 23, 0.56);
}

.date-availability span {
  flex: 0 0 auto;
  color: var(--FG_DIM);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.date-availability-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: rgba(166, 186, 218, 0.24);
}

.date-availability button {
  min-height: 26px;
  flex: 0 0 auto;
  border-color: rgba(166, 186, 218, 0.18);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--FG_MUTED);
  background: rgba(11, 17, 29, 0.64);
  font-size: 0.7rem;
  font-weight: 700;
}

.date-availability button.active {
  border-color: rgba(29, 233, 255, 0.56);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(29, 233, 255, 0.2), rgba(29, 233, 255, 0.08)),
    rgba(11, 17, 29, 0.72);
}

.date-availability button.selected {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 18px rgba(29, 233, 255, 0.16);
}

.sheet-nav a,
.sheet-tabs a,
.ghost-link {
  text-decoration: none;
}

.sheet-nav a {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--FG_MUTED);
  background: rgba(17, 26, 44, 0.62);
  font-size: 0.84rem;
  font-weight: 750;
}

.sheet-nav a.active,
.sheet-nav a:hover {
  border-color: var(--CARD_BORDER_CYAN);
  color: var(--FG_COLOR);
  background: var(--BG_SIDEBAR_ACTIVE);
}

.sheet-surface {
  min-width: 0;
  border-radius: 8px;
  padding: 10px;
}

.summary-strip {
  display: grid;
  grid-template-columns: 0.95fr 0.95fr 1.25fr 1.55fr 1.55fr;
  gap: 1px;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 8px;
  overflow: hidden;
  background: var(--BORDER_SUBTLE);
}

.summary-cell {
  position: relative;
  isolation: isolate;
  min-height: 96px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    rgba(17, 26, 44, 0.72);
}

.summary-cell.maps-played-cell {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(17, 26, 44, 0.76);
}

.summary-cell.maps-played-cell::before,
.summary-cell.maps-played-cell::after {
  display: none;
}

.summary-cell.top-hero-cell {
  --top-hero-image: none;
  overflow: hidden;
  padding-right: 92px;
  background:
    radial-gradient(circle at 82% 52%, rgba(255, 255, 255, 0.12), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.014)),
    rgba(17, 26, 44, 0.74);
}

.summary-cell.fun-stat-cell {
  --fun-stat-image: none;
  --fun-stat-glow: 29, 233, 255;
  overflow: hidden;
  padding-right: 86px;
  background:
    radial-gradient(circle at 82% 54%, rgba(var(--fun-stat-glow), 0.22), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.014)),
    rgba(17, 26, 44, 0.74);
}

.summary-cell.fun-stat-cell::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -1;
  width: 44%;
  background-image:
    linear-gradient(90deg, rgba(17, 26, 44, 0), rgba(17, 26, 44, 0.18) 44%, rgba(17, 26, 44, 0.36)),
    var(--fun-stat-image);
  background-position: center 58%;
  background-size: cover;
  opacity: 0.46;
  filter: saturate(1.16);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 86%, transparent);
}

.summary-cell.fun-stat-cell[data-kind="teams"]::before,
.summary-cell.fun-stat-cell[data-kind="players"]::before {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center right 22px;
  opacity: 0.42;
  filter: drop-shadow(0 0 24px rgba(29, 233, 255, 0.16)) saturate(1.12);
}

.summary-art {
  position: absolute;
  inset: 16px 18px auto auto;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  opacity: 1;
}

.summary-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.summary-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}

.count-art img {
  filter:
    brightness(0) saturate(100%)
    invert(80%) sepia(76%) saturate(1200%) hue-rotate(150deg) brightness(102%) contrast(98%)
    drop-shadow(0 0 14px rgba(29, 233, 255, 0.28));
}

.summary-art rect,
.summary-art circle,
.summary-art path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-art rect,
.summary-art circle {
  fill: none;
}

.trophy-art {
  color: rgba(244, 202, 74, 0.84);
  filter: drop-shadow(0 0 12px rgba(244, 202, 74, 0.18));
}

.trophy-art img {
  filter:
    brightness(0) saturate(100%)
    invert(80%) sepia(78%) saturate(540%) hue-rotate(0deg) brightness(98%) contrast(96%)
    drop-shadow(0 0 12px rgba(244, 202, 74, 0.22));
  opacity: 0.92;
}

.summary-cell.top-hero-cell::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -1;
  width: 50%;
  background-image: var(--top-hero-image);
  background-position: center right;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.62;
  filter: saturate(1.1);
  mask-image: linear-gradient(90deg, transparent, #000 28%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%, #000 86%, transparent);
}

.summary-cell.best-map-cell {
  --best-map-image: none;
  overflow: hidden;
}

.summary-cell.best-map-cell::before,
.summary-cell.best-map-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.summary-cell.best-map-cell::before {
  background-image: var(--best-map-image);
  background-position: center;
  background-size: cover;
  opacity: 0.5;
  filter: saturate(0.95);
}

.summary-cell.best-map-cell::after {
  background: linear-gradient(90deg, rgba(7, 11, 19, 0.76), rgba(7, 11, 19, 0.5));
}

.summary-cell.best-map-cell span,
.summary-cell.best-map-cell strong,
.summary-cell.best-map-cell small {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.summary-cell span,
.sheet-title span,
.subhead span {
  color: var(--FG_DIM);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-cell strong {
  display: block;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
  color: var(--FG_COLOR);
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
  line-height: 1.05;
}

.summary-cell small {
  color: var(--FG_MUTED);
  font-weight: 700;
}

.fun-stat-body {
  display: grid;
  grid-template-columns: 30px 40px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
  margin: 7px 0 6px;
}

.fun-stat-body strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1rem, 1.22vw, 1.28rem);
  line-height: 1.05;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fun-stat-icon {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(166, 186, 218, 0.28);
  border-radius: 8px;
  object-fit: cover;
  background: var(--BG_INPUT);
  box-shadow: 0 0 18px rgba(29, 233, 255, 0.08);
}

.fun-stat-icon[data-kind="teams"],
.fun-stat-icon[data-kind="players"] {
  border-radius: 50%;
  object-fit: contain;
  padding: 3px;
}

.fun-stat-icon[data-kind="players"] {
  object-fit: cover;
  padding: 0;
}

.fun-stat-arrow {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border-color: rgba(166, 186, 218, 0.22);
  border-radius: 50%;
  padding: 0;
  color: var(--FG_MUTED);
  background: rgba(8, 13, 23, 0.48);
  font-size: 0.88rem;
  font-weight: 750;
}

.fun-stat-arrow:hover {
  color: var(--FG_COLOR);
  background: rgba(29, 233, 255, 0.12);
}

.summary-cell.rate-good strong,
.summary-cell.rate-good #metricRecord {
  color: var(--ACCENT_GREEN);
}

.summary-cell.rate-mid strong,
.summary-cell.rate-mid #metricRecord {
  color: var(--ACCENT_YELLOW);
}

.summary-cell.rate-bad strong,
.summary-cell.rate-bad #metricRecord {
  color: #FF6B6B;
}

.summary-hero-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.summary-hero-line img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid rgba(166, 186, 218, 0.28);
  border-radius: 8px;
  object-fit: cover;
  background: var(--BG_INPUT);
}

.sheet-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 1px;
  margin-top: 10px;
  border-bottom: 1px solid var(--BORDER_COLOR);
}

.sheet-tabs a {
  border: 1px solid var(--BORDER_COLOR);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 10px 15px;
  color: var(--FG_MUTED);
  background: var(--BUTTON_GHOST);
  font-size: 0.82rem;
  font-weight: 650;
}

.sheet-tabs a.active,
.sheet-tabs a:hover {
  color: #ffffff;
  background: var(--BG_SIDEBAR_ACTIVE);
}

.sheet-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.sheet-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)),
    rgba(20, 27, 43, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.12);
}

.sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--BORDER_COLOR);
  padding: 9px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.012)),
    rgba(17, 26, 44, 0.82);
}

.sheet-title h2 {
  margin-top: 3px;
}

.sheet-title > span,
.ghost-link {
  white-space: nowrap;
}

.sort-controls,
.subhead-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-chip {
  min-height: 32px;
  border-color: rgba(166, 186, 218, 0.22);
  padding: 0 11px;
  color: var(--FG_MUTED);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--BUTTON_GHOST);
  font-size: 0.72rem;
  font-weight: 700;
}

.sort-chip-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: rgba(166, 186, 218, 0.24);
  vertical-align: middle;
}

.sort-chip-hint {
  color: var(--FG_DIM);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sortable-headers th[data-sort-target] {
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease, background 120ms ease;
}

.sortable-headers th[data-sort-target]:hover {
  color: var(--FG_COLOR);
  background: rgba(255, 255, 255, 0.04);
}

.sortable-headers th[data-sort-target].active-sort {
  color: var(--ACCENT_CYAN);
}

.sortable-headers th[data-sort-target].active-sort::after {
  content: " ↓";
}

.sortable-headers th[data-sort-target].active-sort.asc::after {
  content: " ↑";
}

.sort-chip[aria-pressed="true"] {
  border-color: var(--CARD_BORDER_CYAN);
  color: var(--FG_COLOR);
  background:
    linear-gradient(180deg, rgba(29, 233, 255, 0.16), rgba(29, 233, 255, 0.05)),
    var(--BUTTON_GHOST_HOVER);
}

.sort-chip:hover,
.sort-chip.active {
  border-color: var(--CARD_BORDER_CYAN);
  color: var(--FG_COLOR);
  background:
    linear-gradient(180deg, rgba(29, 233, 255, 0.16), rgba(29, 233, 255, 0.05)),
    var(--BUTTON_GHOST_HOVER);
}

.ghost-link {
  color: var(--ACCENT_CYAN);
  font-size: 0.8rem;
  font-weight: 650;
}

.ghost-link:hover {
  color: #ffffff;
}

.cluster-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.72fr) minmax(260px, 0.85fr);
  gap: 1px;
  background: var(--BORDER_SUBTLE);
}

.cluster-grid > div {
  min-width: 0;
  background: var(--BG_PANEL);
}

.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--BORDER_SUBTLE);
  padding: 7px 8px;
  background: rgba(11, 17, 29, 0.58);
}

.sheet-table-wrap {
  width: 100%;
  max-height: none;
  overflow: visible;
}

.sheet-table-wrap.tall {
  max-height: none;
}

.sheet-table-wrap.full-log {
  height: auto;
  max-height: none;
}

.sheet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.sheet-table:not(.match-log-table) {
  table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
  border-right: 1px solid var(--BORDER_SUBTLE);
  border-bottom: 1px solid var(--BORDER_SUBTLE);
  padding: 7px 8px;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sheet-table:not(.match-log-table) th:not(:first-child),
.sheet-table:not(.match-log-table) td:not(:first-child) {
  text-align: center;
}

.sheet-table:not(.match-log-table) td:not(:first-child) .player-cell,
.sheet-table:not(.match-log-table) td:not(:first-child) .hero-cell,
.sheet-table:not(.match-log-table) td:not(:first-child) .team-cell,
.sheet-table:not(.match-log-table) td:not(:first-child) .map-cell {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 4px 10px;
  margin: 0;
  border-radius: 6px;
  background: rgba(8, 13, 23, 0.4);
  text-align: left;
  line-height: 1.18;
}

.sheet-table:not(.match-log-table) td:not(:first-child) .hero-cell img {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

/* Subtle caption under panel subheads. Used on Map Stats to explain the
   "bar width = games played, % = win rate" encoding that isn't otherwise
   obvious from the rendered bar. */
.bar-legend {
  margin: -2px 0 6px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(216, 226, 242, 0.55);
}

/* Players sortable table: give the Most Played Hero column enough room so
   "Elsa Bloodstone" doesn't break to a new line or spill into the Maps
   column. 4th column = "Most Played Hero". Forcing both the cell width AND
   clipping the hero-cell so long names never escape the column boundary. */
body[data-page="players"] .sheet-table th:nth-child(4),
body[data-page="players"] .sheet-table td:nth-child(4) {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

body[data-page="players"] .sheet-table td:nth-child(4) .hero-cell {
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
}

/* The flex layout in the base .hero-cell uses min-width:auto which lets
   children grow past the cell. Force the text node to ellipsize cleanly. */
body[data-page="players"] .sheet-table td:nth-child(4) .hero-cell > * {
  min-width: 0;
}

.sheet-table:not(.match-log-table) td:not(:first-child) .player-cell.has-team {
  justify-content: flex-start;
}

.sheet-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--FG_MUTED);
  background: var(--BG_INPUT);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sheet-table td {
  color: var(--FG_COLOR);
  background: rgba(20, 27, 43, 0.86);
  font-weight: 600;
}

.sheet-table td.rate-good {
  color: var(--ACCENT_GREEN);
  background: rgba(46, 204, 113, 0.1) !important;
  font-weight: 700;
}

.sheet-table td.rate-mid {
  color: var(--ACCENT_YELLOW);
  background: rgba(240, 192, 64, 0.1) !important;
  font-weight: 700;
}

.sheet-table td.rate-bad {
  color: #FF6B6B;
  background: rgba(255, 82, 98, 0.1) !important;
  font-weight: 700;
}

.sheet-table tr:nth-child(even) td {
  background: rgba(17, 24, 39, 0.9);
}

.sheet-table tr:hover td {
  background: var(--BG_SIDEBAR_ACTIVE);
}

.bars {
  display: grid;
  gap: 7px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    rgba(24, 34, 53, 0.7);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.05fr) minmax(190px, 2fr) 88px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 8px;
  padding: 6px 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.014)),
    rgba(20, 27, 43, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 20px rgba(0, 0, 0, 0.08);
}

.bar-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  color: var(--FG_COLOR);
  font-weight: 700;
}

.bar-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-name img {
  width: 68px;
  height: 44px;
  flex: 0 0 68px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center 62%;
  background: var(--BG_INPUT);
}

.bar-track {
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(166, 186, 218, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.018)),
    var(--BUTTON_MUTED);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.bar-fill {
  position: relative;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--rate-color, var(--ACCENT_YELLOW)) 72%, #ffffff), var(--rate-color, var(--ACCENT_YELLOW)) 62%, color-mix(in srgb, var(--rate-color, var(--ACCENT_YELLOW)) 78%, #000000)),
    var(--rate-color, var(--ACCENT_YELLOW));
  box-shadow:
    0 0 34px color-mix(in srgb, var(--rate-color, var(--ACCENT_YELLOW)) 84%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  filter: saturate(1.55) brightness(1.08);
}

.bar-fill::after {
  content: "";
  position: absolute;
  inset: 1px 8px auto 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.bar-value {
  color: var(--FG_MUTED);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: right;
}

.compact .bar-row {
  grid-template-columns: minmax(100px, 1fr) minmax(130px, 1.6fr) 76px;
  min-height: 46px;
}

.team-cell,
.hero-cell,
.player-cell,
.map-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.player-cell.has-team {
  --player-team-glow: 166, 186, 218;
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100%;
  min-height: 52px;
  padding: 6px 14px 6px 8px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8, 13, 23, 0.74) 35%, rgba(8, 13, 23, 0.4) 60%, rgba(var(--player-team-glow), 0.18)),
    rgba(11, 17, 29, 0.78);
  justify-content: flex-start;
  text-align: left;
  font-weight: 700;
  margin: 0;
  box-sizing: border-box;
}

.player-cell.has-team img {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
}

.player-cell.has-team::before {
  content: "";
  position: absolute;
  inset: -4px -10px -4px auto;
  width: 56%;
  z-index: -1;
  background-image: var(--player-team-logo);
  background-position: right center;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.32;
  filter: saturate(1.1);
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 86%, transparent);
}

.team-cell .logo-box {
  width: 38px;
  height: 38px;
}

.hero-cell img,
.player-cell img,
.map-cell img,
.initial-badge {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.hero-cell img,
.player-cell img,
.map-cell img {
  border-radius: 6px;
  object-fit: cover;
  background: var(--BG_INPUT);
}

body[data-page="ban-rates"] .hero-cell {
  gap: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 340px;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: break-word;
}

body[data-page="ban-rates"] .hero-cell img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

body[data-page="ban-rates"] .sheet-table th:first-child,
body[data-page="ban-rates"] .sheet-table td:first-child {
  width: 380px;
}

body[data-page="ban-rates"] .sheet-table {
  table-layout: auto;
}

body[data-page="hero-rates"] .hero-cell {
  min-width: 0;
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: break-word;
}

body[data-page="hero-rates"] .hero-cell img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
}

body[data-page="hero-rates"] .player-cell img {
  width: 46px;
  height: 46px;
}

body[data-page="hero-rates"] .match-map-card.mini {
  min-height: 78px;
  padding: 14px 16px;
}

body[data-page="hero-rates"] .match-map-card.mini .match-map-name {
  font-size: 1rem;
  white-space: normal;
}

body[data-page="hero-rates"] .sheet-table th:first-child,
body[data-page="hero-rates"] .sheet-table td:first-child {
  width: 17%;
}

body[data-page="hero-rates"] .sheet-table th:nth-child(5),
body[data-page="hero-rates"] .sheet-table td:nth-child(5) {
  width: 6%;
  text-align: center;
}

body[data-page="hero-rates"] .sheet-table th:nth-child(6),
body[data-page="hero-rates"] .sheet-table td:nth-child(6) {
  width: 13%;
}

body[data-page="hero-rates"] .sheet-table th:nth-child(7),
body[data-page="hero-rates"] .sheet-table td:nth-child(7),
body[data-page="hero-rates"] .sheet-table th:nth-child(8),
body[data-page="hero-rates"] .sheet-table td:nth-child(8) {
  width: 7%;
}

body[data-page="hero-rates"] .sheet-table th:nth-child(8),
body[data-page="hero-rates"] .sheet-table td:nth-child(8) {
  min-width: 102px;
}

body[data-page="hero-rates"] .sheet-table th:nth-child(12),
body[data-page="hero-rates"] .sheet-table td:nth-child(12) {
  width: 14%;
}

body[data-page="hero-rates"] .sheet-table th:nth-child(13),
body[data-page="hero-rates"] .sheet-table td:nth-child(13) {
  width: 12%;
}

body[data-page="map-stats"] .map-cell {
  gap: 12px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.12;
}

body[data-page="map-stats"] .map-cell img {
  width: 126px;
  height: 74px;
  border-radius: 8px;
  object-position: center 62%;
}

body[data-page="map-stats"] .bar-row {
  min-height: 70px;
  grid-template-columns: minmax(170px, 1.05fr) minmax(128px, 1.1fr) 66px;
  gap: 8px;
}

body[data-page="map-stats"] .bar-name img {
  width: 98px;
  height: 60px;
  flex-basis: 98px;
}

body[data-page="map-stats"] .compact .bar-row {
  grid-template-columns: minmax(128px, 0.9fr) minmax(118px, 1fr) 58px;
}

body[data-page="map-stats"] .compact .bar-name img {
  display: none;
}

body[data-page="map-stats"] .sheet-table th:first-child,
body[data-page="map-stats"] .sheet-table td:first-child {
  width: 34%;
}

.opponent-card,
.match-map-card {
  --team-glow: 255, 45, 111;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 70px;
  overflow: hidden;
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 13, 23, 0.96), rgba(10, 18, 31, 0.72) 52%, rgba(var(--team-glow), 0.18)),
    radial-gradient(circle at 8% 18%, rgba(var(--team-glow), 0.16), transparent 34%),
    rgba(11, 17, 29, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035),
    0 14px 30px rgba(0, 0, 0, 0.18);
}

.opponent-card {
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
}

.opponent-card::before,
.match-map-card::before,
.match-map-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.opponent-card::before {
  inset: 4px var(--team-mark-right, -12px) 4px auto;
  width: 136px;
  background-image: var(--opponent-logo);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: blur(0.4px) saturate(1.08);
  opacity: 0.24;
  transform: scale(1.08);
}

.opponent-logo {
  width: 58px;
  height: 58px;
  background:
    radial-gradient(circle at 45% 36%, rgba(255, 255, 255, 0.14), transparent 38%),
    rgba(8, 13, 23, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(29, 233, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.24);
}

.opponent-card.team-sentinels {
  border-color: rgba(232, 19, 76, 0.38);
  background:
    linear-gradient(90deg, rgba(8, 13, 23, 0.97), rgba(18, 18, 33, 0.86) 56%, rgba(232, 19, 76, 0.18)),
    radial-gradient(circle at 10% 24%, rgba(232, 19, 76, 0.2), transparent 34%),
    rgba(11, 17, 29, 0.86);
}

.opponent-card.team-sentinels .opponent-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.opponent-card.team-sentinels::before {
  inset: 0 0 0 auto;
  width: 180px;
  opacity: 0.42;
  filter: saturate(1.12);
  background-position: right center;
  background-size: contain;
  background-repeat: no-repeat;
  transform: none;
}

.opponent-card.team-equinox {
  border-color: rgba(245, 248, 255, 0.32);
  background:
    linear-gradient(90deg, rgba(8, 13, 23, 0.97), rgba(18, 22, 34, 0.84) 56%, rgba(245, 248, 255, 0.14)),
    radial-gradient(circle at 10% 24%, rgba(245, 248, 255, 0.16), transparent 34%),
    rgba(11, 17, 29, 0.86);
}

.opponent-card.team-equinox .opponent-logo {
  background:
    radial-gradient(circle at 45% 36%, rgba(255, 255, 255, 0.2), transparent 38%),
    rgba(245, 248, 255, 0.06);
}

.opponent-card.team-equinox .opponent-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.opponent-card.team-equinox::before {
  inset: 0 0 0 auto;
  width: 180px;
  opacity: 0.38;
  filter: saturate(1.1);
  background-position: right center;
  background-size: contain;
  background-repeat: no-repeat;
  transform: none;
}

.opponent-card.team-team-liquid-citadel .opponent-logo {
  border-radius: 8px;
}

.opponent-card.team-team-liquid-citadel .opponent-logo img {
  object-fit: contain;
  padding: 4px;
  transform: scale(0.88);
}

.opponent-card.team-team-liquid-citadel::before {
  width: 150px;
  opacity: 0.25;
  transform: scale(0.98);
}

.opponent-card.team-swamp-gaming .opponent-logo img {
  object-fit: contain;
  padding: 5px;
  transform: scale(0.88);
}

.opponent-card.team-swamp-gaming::before {
  width: 122px;
  opacity: 0.2;
  transform: scale(0.98);
}

.opponent-name {
  overflow: hidden;
  color: var(--FG_COLOR);
  font-size: 1rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-map-card {
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
}

.opponent-card.mini,
.match-map-card.mini {
  min-height: 48px;
  padding: 7px 9px;
}

.opponent-card.mini {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
}

.opponent-card.mini::before {
  width: 78px;
}

.opponent-card.mini .opponent-logo {
  width: 34px;
  height: 34px;
}

.opponent-card.mini .opponent-name,
.match-map-card.mini .match-map-name {
  font-size: 0.86rem;
}

.match-map-card::before {
  background-image: var(--map-image);
  background-position: center var(--map-y, 60%);
  background-size: cover;
  filter: saturate(1.08);
  opacity: 0.58;
  transform: scale(1.08);
}

.match-map-card::after {
  background:
    linear-gradient(90deg, rgba(7, 11, 19, 0.9), rgba(7, 11, 19, 0.46) 58%, rgba(7, 11, 19, 0.18)),
    radial-gradient(circle at 88% 18%, rgba(29, 233, 255, 0.22), transparent 38%);
  backdrop-filter: blur(1.2px);
  -webkit-backdrop-filter: blur(1.2px);
}

.match-map-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 750;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.replay-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 0 14px;
  color: #ffffff;
  background: rgba(8, 13, 23, 0.78);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.replay-pill:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(20, 28, 44, 0.92);
}

.replay-pill.copied {
  border-color: rgba(46, 204, 113, 0.7);
  color: var(--ACCENT_GREEN);
}

.vod-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(255, 45, 111, 0.42);
  border-radius: 999px;
  padding: 0 9px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 45, 111, 0.72), rgba(168, 29, 73, 0.74)),
    var(--BUTTON_DANGER);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 18px rgba(255, 45, 111, 0.14);
}

.vod-link:hover {
  background:
    linear-gradient(180deg, rgba(255, 74, 132, 0.86), rgba(168, 29, 73, 0.78)),
    var(--ACCENT_PINK_HOVER);
}

.vod-link.redacted {
  border-color: rgba(255, 82, 98, 0.34);
  color: #FF8C99;
  background:
    linear-gradient(180deg, rgba(255, 82, 98, 0.13), rgba(255, 82, 98, 0.04)),
    rgba(8, 13, 23, 0.72);
}

.vod-link.placeholder {
  visibility: hidden;
}

.vod-link.has-play {
  gap: 6px;
}

.vod-link .vod-play-icon {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  display: inline-block;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
  transition: transform 120ms ease;
}

.vod-link:hover .vod-play-icon {
  transform: scale(1.18);
}

.vod-link.disabled {
  border-color: var(--BORDER_COLOR);
  color: var(--FG_DIM);
  background: var(--BUTTON_GHOST);
  font-weight: 700;
  pointer-events: none;
  cursor: default;
}

.initial-badge {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--CARD_BORDER_CYAN);
  border-radius: 50%;
  color: var(--FG_COLOR);
  background: var(--BG_INPUT);
  font-size: 0.64rem;
  font-weight: 700;
}

.match-log-table thead {
  display: none;
}

.match-log-table,
.match-log-table tbody,
.match-log-table tr,
.match-log-table td {
  display: block;
  width: 100%;
}

.match-log-table tr:nth-child(even) td,
.match-log-table tr:hover td {
  background: transparent;
}

.match-card-row > td {
  border-right: 0;
  padding: 0;
  background: transparent;
}

.match-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(110, 145, 198, 0.34);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 12px 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.008)),
    rgba(8, 13, 23, 0.24);
}

.match-card.match-win {
  border-color: rgba(46, 204, 113, 0.28);
  background:
    linear-gradient(90deg, rgba(46, 204, 113, 0.18), rgba(46, 204, 113, 0.08) 38%, rgba(46, 204, 113, 0.04) 72%, transparent),
    rgba(8, 13, 23, 0.36);
}

.match-card.match-loss {
  border-color: rgba(255, 82, 98, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 82, 98, 0.16), rgba(255, 82, 98, 0.07) 38%, rgba(255, 82, 98, 0.035) 72%, transparent),
    rgba(8, 13, 23, 0.36);
}

.match-card-main {
  display: grid;
  grid-template-columns: 78px minmax(210px, 1fr) minmax(150px, 0.6fr) minmax(260px, 1.25fr) minmax(360px, 1.2fr);
  gap: 10px;
  align-items: stretch;
}

.match-date,
.match-mode,
.match-result-stack {
  display: grid;
  align-items: center;
  min-height: 70px;
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 8px;
  padding: 10px;
  background: rgba(11, 17, 29, 0.58);
  font-weight: 700;
}

.match-mode {
  place-items: center;
  font-size: 1.28rem;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.match-result-stack {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  place-items: center;
  gap: 7px;
  text-align: center;
}

.match-result-stack > * {
  min-width: 0;
  justify-self: stretch;
}

.match-result-stack.with-vod {
  grid-template-columns: minmax(60px, 0.75fr) minmax(72px, 0.85fr) minmax(120px, 1.6fr) minmax(72px, 0.8fr);
}

.match-result-stack.result-win {
  border-color: rgba(46, 204, 113, 0.34);
  background:
    radial-gradient(circle at 50% 50%, rgba(46, 204, 113, 0.24), transparent 68%),
    rgba(11, 17, 29, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 22px rgba(46, 204, 113, 0.12);
}

.match-result-stack.result-loss {
  border-color: rgba(255, 82, 98, 0.34);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 82, 98, 0.23), transparent 68%),
    rgba(11, 17, 29, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 22px rgba(255, 82, 98, 0.12);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 100%;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 999px;
  color: var(--FG_COLOR);
  background: rgba(8, 13, 23, 0.72);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: center;
}

.match-result-stack .replay-pill {
  width: 100%;
  min-height: 42px;
  font-size: 0.9rem;
}

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

.result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 78px;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.result.win {
  color: #06100b;
  background: var(--ACCENT_GREEN);
}

.result.loss {
  color: #ffffff;
  background: var(--BUTTON_DANGER);
}

.replay-id-pill,
.rate-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.replay-id-pill {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  background: rgba(8, 13, 23, 0.72);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.replay-id-pill:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(20, 28, 44, 0.92);
}

.replay-id-pill.copied {
  border-color: rgba(46, 204, 113, 0.7);
  color: var(--ACCENT_GREEN);
}

.history-date {
  display: grid;
  gap: 2px;
  font-weight: 700;
}

.history-date small {
  color: var(--FG_DIM);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.rate-chip.neutral {
  border: 1px solid rgba(166, 186, 218, 0.2);
  color: var(--FG_MUTED);
  background: rgba(8, 13, 23, 0.42);
}

.rate-chip.muted {
  border: 1px solid rgba(166, 186, 218, 0.16);
  color: var(--FG_DIM);
  background: rgba(8, 13, 23, 0.32);
}

.rate-good,
.rank-value,
.positive {
  color: var(--ACCENT_GREEN);
  font-weight: 700;
}

.rate-mid {
  color: var(--ACCENT_YELLOW);
  font-weight: 700;
}

.rate-bad,
.negative {
  color: #FF6B6B;
  font-weight: 700;
}

.comp-finder-picker {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(166, 186, 218, 0.22);
  border-radius: 8px;
}

.comp-finder-picker label {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  padding: 0;
  background: transparent;
  text-transform: none;
  text-align: center;
}

.comp-finder-picker label span {
  color: var(--FG_MUTED);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.comp-finder-select {
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
}

.draft-replay-copy {
  cursor: pointer;
  border-bottom: 1px dashed rgba(166, 186, 218, 0.36);
  font-variant-numeric: tabular-nums;
  transition: color 120ms ease, border-color 120ms ease;
}

.draft-replay-copy:hover {
  color: var(--FG_COLOR);
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.draft-replay-copy.copied {
  color: var(--ACCENT_GREEN);
  border-bottom-color: var(--ACCENT_GREEN);
}

.comp-finder-badge[hidden] {
  display: none !important;
}

.comp-finder-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 10px;
  border: 1px solid rgba(166, 186, 218, 0.22);
  border-radius: 999px;
  background: rgba(8, 13, 23, 0.6);
}

.comp-finder-badge img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(8, 13, 23, 0.7);
}

.comp-finder-badge div {
  display: grid;
  gap: 1px;
}

.comp-finder-badge small {
  color: var(--FG_DIM);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comp-finder-badge strong {
  color: var(--FG_COLOR);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
}

.comp-finder-clear {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(166, 186, 218, 0.22);
  border-radius: 50%;
  color: var(--FG_MUTED);
  background: transparent;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.comp-finder-clear:hover {
  color: var(--FG_COLOR);
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Draft Builder ===== */

.draft-builder-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  padding: 14px;
}

.draft-builder-divider {
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(166, 186, 218, 0.32) 12%, rgba(166, 186, 218, 0.32) 88%, transparent);
  border-radius: 1px;
}

.draft-builder-side .draft-side-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-team-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(166, 186, 218, 0.3);
  border-radius: 999px;
  background: rgba(8, 13, 23, 0.6);
  color: var(--FG_MUTED);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.db-team-tag.is-team-1 {
  border-color: rgba(29, 233, 255, 0.55);
  color: var(--ACCENT_CYAN);
  background: rgba(29, 233, 255, 0.08);
}

.draft-builder-side {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.draft-builder-side .draft-side-label {
  margin: 0;
  color: var(--FG_MUTED);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.draft-builder-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.db-slot {
  position: relative;
  aspect-ratio: 1 / 1.2;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
  border: 2px dashed rgba(166, 186, 218, 0.28);
  border-radius: 8px;
  padding: 5px;
  background: rgba(11, 17, 29, 0.4);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.db-slot.kind-ban {
  border-color: rgba(255, 82, 98, 0.45);
  background:
    linear-gradient(135deg, rgba(255, 82, 98, 0.06), transparent 56%),
    rgba(11, 17, 29, 0.55);
}

.db-slot.kind-save {
  border-color: rgba(91, 201, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(91, 201, 255, 0.07), transparent 56%),
    rgba(11, 17, 29, 0.55);
}

/* Planned-comp slots: greener accent, role-tinted when filled. */
.db-slot.kind-comp {
  border-color: rgba(107, 246, 166, 0.32);
  background:
    linear-gradient(135deg, rgba(107, 246, 166, 0.05), transparent 60%),
    rgba(11, 17, 29, 0.55);
}
.db-slot.kind-comp.filled { border-color: rgba(107, 246, 166, 0.6); }
.db-slot.kind-comp.role-vanguard.filled { border-color: rgba(91, 201, 255, 0.78); }
.db-slot.kind-comp.role-duelist.filled { border-color: rgba(255, 107, 107, 0.78); }
.db-slot.kind-comp.role-strategist.filled { border-color: rgba(107, 246, 166, 0.78); }
.db-slot.kind-comp .db-slot-label { color: rgba(216, 226, 242, 0.75); }
.db-slot.kind-comp.role-vanguard .db-slot-label { color: #5BC9FF; }
.db-slot.kind-comp.role-duelist .db-slot-label { color: #FF6B6B; }
.db-slot.kind-comp.role-strategist .db-slot-label { color: #6BF6A6; }

.draft-builder-plan {
  margin: 0 14px 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(166, 186, 218, 0.16);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.draft-builder-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.draft-builder-plan-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(216, 226, 242, 0.7);
}

.draft-builder-plan .comp-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.draft-builder-plan .comp-slots .db-slot.kind-comp {
  flex: 0 0 86px;
  width: 86px;
  max-width: 86px;
  justify-self: unset;
}

.sort-chip.subtle {
  background: transparent;
  border-color: rgba(166, 186, 218, 0.22);
  color: rgba(216, 226, 242, 0.75);
  padding: 2px 8px;
  font-size: 0.66rem;
}

/* Compact comp slots — square portraits, ~half the height of ban/save slots
   so the whole page fits without scrolling. */
.db-slot.kind-comp {
  aspect-ratio: 1 / 1.18;
  max-width: 110px;
  justify-self: center;
  grid-template-rows: auto 1fr;
  padding: 4px;
  min-height: 0;
}

.db-slot.kind-comp .db-slot-label {
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  padding: 0;
  text-align: center;
}

.db-slot.kind-comp .db-slot-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
}

.db-slot.kind-comp .db-slot-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
}

.db-slot.kind-comp .db-slot-name {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  font-size: 0.62rem;
  padding: 2px 4px;
  background: rgba(8, 13, 23, 0.78);
  border-radius: 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-slot.kind-comp .db-slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.62rem;
  color: rgba(216, 226, 242, 0.4);
}

.db-slot.filled {
  border-style: solid;
  border-width: 2px;
  background: rgba(11, 17, 29, 0.85);
  cursor: grab;
}

.db-slot.filled:active { cursor: grabbing; }

.db-slot.kind-ban.filled { border-color: rgba(255, 82, 98, 0.78); }
.db-slot.kind-save.filled { border-color: rgba(91, 201, 255, 0.78); }

.db-slot.drag-over {
  border-color: var(--ACCENT_CYAN);
  background: rgba(29, 233, 255, 0.12);
  transform: translateY(-1px);
}

.db-slot-shield {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  color: rgba(91, 201, 255, 0.95);
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(91, 201, 255, 0.4));
}

.db-slot.kind-save.empty .db-slot-portrait {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  gap: 8px;
}

.db-slot.kind-save.empty .db-slot-empty {
  order: 1;
}

.db-slot.kind-save.empty .db-slot-shield {
  position: static;
  order: 2;
  width: 28px;
  height: 28px;
  opacity: 0.65;
}

.db-slot-slash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: rgba(255, 82, 98, 0.85);
  filter: drop-shadow(0 0 6px rgba(255, 82, 98, 0.3));
}

.db-slot.kind-save.filled .db-slot-portrait img {
  opacity: 1;
}

.db-slot.kind-ban.filled .db-slot-portrait img {
  opacity: 0.74;
}

.db-slot-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  color: var(--FG_DIM);
}

.db-slot-portrait {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.db-slot-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  pointer-events: none;
}

.db-slot-name {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.db-slot-empty {
  color: var(--FG_DIM);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.db-hint {
  margin: 0 16px 12px;
  color: var(--FG_DIM);
  font-size: 0.74rem;
}

.db-matchup-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.db-control {
  display: grid;
  gap: 4px;
  padding: 0;
  background: transparent;
  text-transform: none;
}

.db-control > span {
  color: var(--FG_DIM);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.db-control > select {
  min-height: 38px;
  min-width: 180px;
}

.sort-chip.primary {
  border-color: rgba(76, 201, 224, 0.5);
  color: var(--ACCENT_CYAN);
  background:
    linear-gradient(180deg, rgba(29, 233, 255, 0.14), rgba(29, 233, 255, 0.04)),
    var(--BUTTON_GHOST);
}

.sort-chip.danger {
  color: var(--bad, #ff6b6b);
}

.db-saved-list {
  padding: 12px 16px 16px;
}

.db-saved-empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed rgba(166, 186, 218, 0.22);
  border-radius: 8px;
  color: var(--FG_DIM);
  font-size: 0.78rem;
}

.db-saved-filters {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 8px;
  background: rgba(8, 13, 23, 0.4);
}

.db-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.db-filter-row-label {
  flex: 0 0 56px;
  color: var(--FG_DIM);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.db-filter-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(166, 186, 218, 0.12);
  border-radius: 6px;
  background: rgba(8, 13, 23, 0.5);
}

.db-filter-group-label {
  color: var(--FG_DIM);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 4px;
}

.team-chip {
  position: relative;
  isolation: isolate;
  padding-left: 32px;
  overflow: hidden;
}

.team-chip .team-chip-logo {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background-image: var(--team-chip-logo);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  background-color: rgba(8, 13, 23, 0.6);
  pointer-events: none;
}

.team-chip .team-chip-label {
  position: relative;
  z-index: 1;
}

.db-saved-strip {
  display: flex;
  gap: 10px;
  padding: 4px 2px 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(166, 186, 218, 0.32) transparent;
}

.db-saved-strip::-webkit-scrollbar {
  height: 10px;
}

.db-saved-strip::-webkit-scrollbar-track {
  background: transparent;
}

.db-saved-strip::-webkit-scrollbar-thumb {
  background: rgba(166, 186, 218, 0.28);
  border-radius: 999px;
}

.db-saved-strip::-webkit-scrollbar-thumb:hover {
  background: rgba(166, 186, 218, 0.48);
}

.db-saved-strip .db-saved-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
}

.db-saved-author {
  color: var(--ACCENT_CYAN) !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ===== First Fight viz ===== */

.first-fight-body { padding: 8px; }

.first-fight-team {
  --team-glow: 166, 186, 218;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--team-glow), 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--team-glow), 0.04), transparent 60%),
    rgba(11, 17, 29, 0.5);
}

.first-fight-team-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(166, 186, 218, 0.14);
}

.first-fight-team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(8, 13, 23, 0.6);
}

.first-fight-team-header span {
  display: block;
  color: var(--FG_DIM);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.first-fight-team-header h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 750;
}

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

.first-fight-side {
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(8, 13, 23, 0.4);
}

.first-fight-side h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--FG_MUTED);
}

.first-fight-side.tone-good h4 { color: var(--ACCENT_GREEN); }
.first-fight-side.tone-bad h4 { color: var(--ACCENT_PINK); }

.first-fight-bars { display: grid; gap: 6px; }

/* Player | bar | Count | Share | Map W% */
.ff-bar-head,
.ff-bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 48px 52px 86px;
  align-items: center;
  gap: 10px;
}

.ff-bar-head {
  padding-bottom: 5px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(166, 186, 218, 0.16);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(216, 226, 242, 0.7);
}

.ff-bar-row { font-size: 0.78rem; }

.ff-bar-head-count,
.ff-bar-head-share,
.ff-bar-head-rate,
.ff-bar-count,
.ff-bar-share,
.ff-bar-rate {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ff-bar-count { color: var(--FG_COLOR); font-weight: 700; }
.ff-bar-share { color: var(--FG_DIM); font-weight: 600; font-size: 0.72rem; }

.ff-bar-name {
  color: var(--FG_COLOR);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-bar-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(8, 13, 23, 0.7);
  overflow: hidden;
}

.first-fight-side.tone-good .ff-bar-fill { background: linear-gradient(90deg, rgba(46, 204, 113, 0.4), var(--ACCENT_GREEN)); }
.first-fight-side.tone-bad  .ff-bar-fill { background: linear-gradient(90deg, rgba(255, 82, 98, 0.4), var(--ACCENT_PINK)); }
.first-fight-side.tone-neutral .ff-bar-fill { background: linear-gradient(90deg, rgba(76, 201, 224, 0.4), var(--ACCENT_CYAN)); }

.ff-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 200ms ease;
}

.ff-bar-value {
  color: var(--FG_COLOR);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ff-bar-value small {
  display: inline-block;
  color: var(--FG_DIM);
  font-weight: 600;
  font-size: 0.72em;
}

.ff-bar-rate {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .first-fight-grid { grid-template-columns: 1fr; }
}

.db-saved-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(166, 186, 218, 0.2);
  border-radius: 8px;
  background: rgba(11, 17, 29, 0.6);
  overflow: hidden;
}

.db-saved-card-thumbs {
  position: relative;
  height: 70px;
  margin: -10px -12px 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.db-saved-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-saved-map.empty {
  background:
    linear-gradient(135deg, rgba(166, 186, 218, 0.12), rgba(11, 17, 29, 0.6));
}

.db-saved-team {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 13, 23, 0.85);
  padding: 3px;
}

.db-saved-card header {
  display: grid;
  gap: 2px;
}

.db-saved-card strong {
  color: var(--FG_COLOR);
  font-size: 0.86rem;
  font-weight: 700;
}

.db-saved-card small {
  color: var(--FG_DIM);
  font-size: 0.7rem;
}

.db-saved-tags {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-saved-tags .db-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.db-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(120, 170, 255, 0.14);
  border: 1px solid rgba(120, 170, 255, 0.42);
  border-radius: 999px;
  color: rgba(216, 226, 242, 0.96);
}

.db-tag-remove {
  background: transparent;
  border: 0;
  color: rgba(216, 226, 242, 0.6);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 3px;
}

.db-tag-remove:hover { color: #ff8585; background: rgba(255, 102, 102, 0.16); }

.db-tag-form { display: inline-flex; }

.db-tag-form input {
  background: rgba(12, 18, 32, 0.6);
  border: 1px dashed rgba(166, 186, 218, 0.32);
  border-radius: 999px;
  color: var(--text-primary, #eaf0fb);
  padding: 2px 10px;
  font: inherit;
  font-size: 0.66rem;
  min-width: 130px;
}

/* Collapse the suggestion chips by default — they reveal when the tag input
   inside the same .db-saved-tags section gets focus. Keeps each saved card
   short. */
.db-tag-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.db-saved-tags:focus-within .db-tag-suggestions {
  display: flex;
}

.db-tag-suggest {
  background: transparent;
  border: 1px dashed rgba(166, 186, 218, 0.32);
  color: rgba(216, 226, 242, 0.78);
  border-radius: 999px;
  padding: 2px 8px;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.db-tag-suggest:hover {
  background: rgba(120, 170, 255, 0.14);
  border-style: solid;
  border-color: rgba(120, 170, 255, 0.6);
  color: var(--text-primary, #eaf0fb);
}

.db-tag-form input:focus {
  outline: none;
  border-style: solid;
  border-color: rgba(120, 170, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.16);
}

.sort-chip.tag-chip {
  border-color: rgba(120, 170, 255, 0.45);
  color: rgba(216, 226, 242, 0.92);
}

.sort-chip.tag-chip small {
  margin-left: 4px;
  opacity: 0.6;
  font-weight: 600;
}

.sort-chip.tag-chip.active {
  background: rgba(120, 170, 255, 0.22);
  border-color: rgba(120, 170, 255, 0.85);
}

.db-saved-search {
  margin-left: auto;
}

.db-saved-search input {
  background: rgba(12, 18, 32, 0.6);
  border: 1px solid rgba(166, 186, 218, 0.22);
  border-radius: 6px;
  color: var(--text-primary, #eaf0fb);
  padding: 4px 10px;
  font: inherit;
  font-size: 0.74rem;
  min-width: 240px;
}

.db-saved-search input:focus {
  outline: none;
  border-color: rgba(120, 170, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.16);
}

.db-saved-comp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 4px 0 6px;
}

.db-saved-comp img,
.db-saved-comp .db-saved-comp-empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(166, 186, 218, 0.22);
  background: rgba(11, 17, 29, 0.65);
}

.db-saved-actions {
  display: flex;
  gap: 6px;
}

.db-saved-actions .sort-chip {
  flex: 1;
  min-height: 30px;
  font-size: 0.74rem;
}

.db-saved-comments {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(166, 186, 218, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(216, 226, 242, 0.7);
}

.db-comment-header .db-comment-count {
  font-variant-numeric: tabular-nums;
  background: rgba(166, 186, 218, 0.14);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
}

.db-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.db-comment {
  background: rgba(12, 18, 32, 0.55);
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.db-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: rgba(216, 226, 242, 0.78);
}

.db-comment-meta strong {
  color: var(--text-primary, #eaf0fb);
  font-weight: 600;
}

.db-comment-meta span { opacity: 0.6; }

.db-comment-meta .db-comment-delete {
  margin-left: auto;
  background: transparent;
  color: rgba(216, 226, 242, 0.55);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}

.db-comment-meta .db-comment-delete:hover {
  color: #ff8585;
  background: rgba(255, 102, 102, 0.12);
}

.db-comment p {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(232, 240, 252, 0.92);
  line-height: 1.36;
  white-space: pre-wrap;
  word-break: break-word;
}

.db-comment-empty {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(216, 226, 242, 0.55);
  font-style: italic;
}

.db-comment-empty.muted { opacity: 0.7; }

.db-comment-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-comment-form textarea {
  resize: vertical;
  min-height: 26px;
  height: 26px;
  max-height: 110px;
  background: rgba(12, 18, 32, 0.6);
  border: 1px solid rgba(166, 186, 218, 0.18);
  border-radius: 8px;
  color: var(--text-primary, #eaf0fb);
  padding: 5px 9px;
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.3;
  transition: height 160ms ease, min-height 160ms ease, border-color 120ms ease, box-shadow 120ms ease;
  overflow: hidden;
}

.db-comment-form:focus-within textarea {
  min-height: 56px;
  height: 56px;
  overflow: auto;
}

.db-comment-form textarea:focus {
  outline: none;
  border-color: rgba(120, 170, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.18);
}

.db-comment-form button {
  align-self: flex-end;
  display: none;
}

.db-comment-form:focus-within button { display: inline-flex; }

.db-bank {
  display: grid;
  /* Duelist holds the most heroes (27) so it gets twice the lane width — keeps
     every chip visible in 3-ish rows without needing to scroll within. */
  grid-template-columns: 1fr 2fr 1fr;
  gap: 10px;
  padding: 10px;
  align-items: start;
}

.db-role-column {
  display: grid;
  grid-template-rows: auto 1fr;
  align-self: start;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(166, 186, 218, 0.18);
  border-radius: 8px;
  background: rgba(11, 17, 29, 0.42);
}

.db-role-column h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.db-role-column.role-vanguard {
  border-top: 3px solid #5BC9FF;
}
.db-role-column.role-vanguard h3 { color: #5BC9FF; }

.db-role-column.role-duelist {
  border-top: 3px solid #FF6B6B;
}
.db-role-column.role-duelist h3 { color: #FF6B6B; }

.db-role-column.role-strategist {
  border-top: 3px solid #6BF6A6;
}
.db-role-column.role-strategist h3 { color: #6BF6A6; }

.db-heroes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}

.db-hero-chip {
  display: grid;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(166, 186, 218, 0.18);
  border-radius: 6px;
  background: rgba(8, 13, 23, 0.62);
  cursor: grab;
  text-align: center;
  user-select: none;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.db-hero-chip:hover {
  border-color: var(--ACCENT_CYAN);
  background: rgba(20, 28, 44, 0.86);
  transform: translateY(-1px);
}

.db-hero-chip:active { cursor: grabbing; }

.db-hero-chip.is-variant {
  border-color: rgba(255, 184, 82, 0.4);
}

.db-hero-chip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.db-slot-portrait img {
  -webkit-user-drag: none;
  user-select: none;
}

.db-hero-chip span {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--FG_COLOR);
}

.db-bank-search input {
  min-height: 36px;
  min-width: 220px;
}

/* Click-to-pick popover for ban / save / comp slots. Opens when an empty slot
   is clicked; mirrors the bank columns so all 51 heroes are visible at once. */
.db-slot-picker {
  position: fixed;
  width: min(560px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  background: rgba(10, 14, 22, 0.97);
  border: 1px solid rgba(166, 186, 218, 0.32);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  z-index: 200;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.db-slot-picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(166, 186, 218, 0.18);
}

.db-slot-picker-head strong {
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(216, 226, 242, 0.92);
}

.db-slot-picker-head strong em {
  font-style: normal;
  color: var(--ACCENT_CYAN, #5BC9FF);
  margin-left: 4px;
}

.db-slot-picker-head input {
  flex: 1;
  background: rgba(12, 18, 32, 0.6);
  border: 1px solid rgba(166, 186, 218, 0.22);
  border-radius: 6px;
  color: var(--text-primary, #eaf0fb);
  padding: 4px 10px;
  font: inherit;
  font-size: 0.74rem;
}

.db-slot-picker-head input:focus {
  outline: none;
  border-color: rgba(120, 170, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.16);
}

.db-slot-picker-head #db-slot-picker-close {
  background: transparent;
  border: 0;
  color: rgba(216, 226, 242, 0.78);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.db-slot-picker-head #db-slot-picker-close:hover {
  color: var(--text-primary, #eaf0fb);
  background: rgba(166, 186, 218, 0.14);
}

.db-slot-picker-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 8px;
  padding: 10px;
  overflow: auto;
}

.db-slot-picker-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
}

.db-slot-picker-col h4 {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.db-slot-picker-col.role-vanguard h4 { color: #5BC9FF; }
.db-slot-picker-col.role-duelist h4  { color: #FF6B6B; }
.db-slot-picker-col.role-strategist h4 { color: #6BF6A6; }

.db-slot-picker-col.suggested {
  background: rgba(120, 170, 255, 0.07);
  outline: 1px solid rgba(120, 170, 255, 0.4);
}

.db-slot-picker-heroes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 4px;
}

.db-slot-picker-hero {
  display: grid;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(166, 186, 218, 0.18);
  border-radius: 6px;
  background: rgba(8, 13, 23, 0.62);
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: var(--text-primary, #eaf0fb);
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.db-slot-picker-hero:hover {
  border-color: var(--ACCENT_CYAN, #5BC9FF);
  background: rgba(20, 28, 44, 0.86);
  transform: translateY(-1px);
}

.db-slot-picker-hero img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.db-slot-picker-hero span {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .draft-builder-grid {
    grid-template-columns: 1fr;
  }
  .db-bank {
    grid-template-columns: 1fr;
  }
}

.table-prompt {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed rgba(166, 186, 218, 0.22);
  border-radius: 8px;
  color: var(--FG_MUTED);
  background:
    radial-gradient(circle at 50% 0%, rgba(29, 233, 255, 0.08), transparent 42%),
    rgba(8, 13, 23, 0.28);
  font-weight: 700;
  text-align: center;
}

.comp-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.comp-insight-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(166, 186, 218, 0.16);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.014)),
    rgba(17, 26, 44, 0.74);
}

.comp-insight-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: rgba(166, 186, 218, 0.18);
}

.comp-insight-card.rate-good::before {
  background: var(--ACCENT_GREEN);
}

.comp-insight-card.rate-mid::before {
  background: var(--ACCENT_YELLOW);
}

.comp-insight-card.rate-bad::before {
  background: #FF6B6B;
}

#compOurTable,
#compEnemyTable,
#compFinderOurTable,
#compFinderEnemyTable,
#compDefinitionsTable {
  table-layout: fixed;
}

.comp-matchup-table {
  table-layout: auto;
}

.sheet-table col.comp-name-col {
  width: 200px;
}

#compOurTable td:first-child,
#compEnemyTable td:first-child,
#compFinderOurTable td:first-child,
#compFinderEnemyTable td:first-child,
#compOurTable th:first-child,
#compEnemyTable th:first-child,
#compFinderOurTable th:first-child,
#compFinderEnemyTable th:first-child,
#compDefinitionsTable td:first-child,
#compDefinitionsTable th:first-child {
  padding-right: 18px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.comp-insight-card span {
  color: var(--FG_DIM);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.comp-insight-card strong {
  display: block;
  margin: 8px 0 5px;
  overflow: hidden;
  color: var(--FG_COLOR);
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-insight-card small {
  color: var(--FG_MUTED);
  font-weight: 700;
}

.mirror-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(178, 103, 255, 0.38);
  border-radius: 999px;
  padding: 0 10px;
  color: #DCC7FF;
  background: rgba(178, 103, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
}

.comp-matchup-group td {
  border-top: 2px solid rgba(29, 233, 255, 0.22);
  border-bottom: 1px solid rgba(29, 233, 255, 0.14);
  background:
    linear-gradient(90deg, rgba(29, 233, 255, 0.1), rgba(178, 103, 255, 0.07)),
    rgba(8, 13, 23, 0.72) !important;
}

.comp-matchup-group strong,
.comp-matchup-group small {
  display: block;
}

.comp-matchup-group strong {
  color: var(--ACCENT_CYAN);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.comp-matchup-group small {
  margin-top: 3px;
  color: var(--FG_MUTED);
  font-size: 0.76rem;
  font-weight: 650;
}

.rank-list,
.map-pool,
.draft-preview {
  display: grid;
  gap: 1px;
  padding: 8px;
  background: var(--BORDER_SUBTLE);
}

.ban-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ban-graph-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.ban-graph-panel {
  min-width: 0;
  border: 1px solid rgba(166, 186, 218, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    rgba(17, 26, 44, 0.66);
}

.ban-graph-panel.our-graph {
  border-color: rgba(29, 233, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(29, 233, 255, 0.08);
}

.ban-graph-panel.their-graph {
  border-color: rgba(255, 45, 111, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 111, 0.08);
}

.ban-graph-panel .subhead {
  padding: 12px;
  border-bottom: 1px solid var(--BORDER_SUBTLE);
  background: rgba(8, 13, 23, 0.34);
}

.ban-graph-panel .subhead h3 {
  margin: 3px 0 0;
  color: var(--FG_COLOR);
  font-size: 1rem;
  text-transform: uppercase;
}

.ban-graph-list {
  display: grid;
  gap: 1px;
  background: var(--BORDER_SUBTLE);
}

.ban-graph-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.35fr);
  gap: 12px;
  padding: 10px;
  background: rgba(17, 26, 44, 0.76);
}

.ban-graph-hero {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.ban-graph-hero img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid rgba(166, 186, 218, 0.24);
  border-radius: 8px;
  object-fit: cover;
  background: var(--BG_INPUT);
}

.ban-graph-hero strong {
  overflow: hidden;
  color: var(--FG_COLOR);
  font-size: 0.92rem;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.ban-graph-bars {
  display: grid;
  gap: 8px;
}

.ban-graph-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.ban-graph-label span,
.ban-graph-metric small {
  color: var(--FG_DIM);
}

.ban-graph-label span {
  color: var(--FG_MUTED);
}

.ban-graph-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 999px;
  background: rgba(8, 13, 23, 0.62);
}

.ban-graph-fill {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 34%),
    var(--rate-color);
  box-shadow: 0 0 16px color-mix(in srgb, var(--rate-color) 54%, transparent);
}

.ban-graph-metric small {
  display: block;
  margin-top: 3px;
  font-size: 0.64rem;
  font-weight: 650;
}

.rank-item,
.map-item,
.ban-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
    rgba(20, 27, 43, 0.76);
}

.rank-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  min-height: 42px;
  padding: 7px 8px;
}

.rank-title {
  color: var(--FG_COLOR);
  font-weight: 650;
}

.rank-meta {
  margin-top: 2px;
  color: var(--FG_DIM);
  font-size: 0.76rem;
  font-weight: 680;
}

.ban-card {
  min-width: 0;
  border: 1px solid rgba(166, 186, 218, 0.14);
  border-radius: 8px;
  padding: 10px;
}

.ban-hero {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.ban-hero img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 8px;
  object-fit: cover;
  background: var(--BG_INPUT);
}

.ban-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.ban-stat {
  min-width: 0;
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 6px;
  padding: 6px 7px;
  background: rgba(8, 13, 23, 0.34);
}

.ban-stat span {
  display: block;
  margin-bottom: 3px;
  color: var(--FG_DIM);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ban-stat strong {
  display: block;
  overflow: hidden;
  color: var(--FG_COLOR);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 6px 8px;
}

.map-thumb {
  width: 96px;
  height: 58px;
  object-fit: cover;
  object-position: center 62%;
  background: var(--BG_INPUT);
}

.map-item strong {
  display: block;
  overflow: hidden;
  color: var(--FG_COLOR);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-item span {
  color: var(--FG_DIM);
  font-size: 0.76rem;
}

.map-rate {
  color: var(--FG_COLOR);
  font-weight: 700;
  text-align: right;
}

.player-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 10px;
}

.player-profile-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(166, 186, 218, 0.18);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.018)),
    rgba(17, 26, 44, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 26px rgba(0, 0, 0, 0.14);
}

.player-profile-card::before,
.player-profile-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.player-profile-card::before {
  inset: 8px -8px auto auto;
  width: 148px;
  height: 120px;
  background-image: var(--player-team-logo);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.14;
  filter: blur(0.3px) saturate(1.14);
}

.player-profile-card::after {
  inset: -30px -28px auto auto;
  width: 170px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--team-glow), 0.22), transparent 68%);
  opacity: 0.75;
}

.player-avatar {
  grid-row: span 2;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(166, 186, 218, 0.28);
  border-radius: 50%;
  object-fit: cover;
  background: var(--BG_INPUT);
}

.player-profile-main {
  min-width: 0;
}

.player-profile-main strong,
.player-profile-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-main strong {
  color: var(--FG_COLOR);
  font-size: 1rem;
  font-weight: 750;
}

.player-profile-main span {
  margin-top: 2px;
  color: var(--FG_DIM);
  font-size: 0.78rem;
  font-weight: 750;
}

.player-profile-hero {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--FG_MUTED);
  font-size: 0.8rem;
  font-weight: 650;
}

.player-profile-hero img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: var(--BG_INPUT);
}

.player-profile-hero span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.player-profile-stats span {
  min-width: 0;
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 8px;
  padding: 7px;
  background: rgba(8, 13, 23, 0.34);
}

.player-profile-stats small,
.player-profile-stats b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-stats small {
  color: var(--FG_DIM);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.player-profile-stats b {
  margin-top: 2px;
  color: var(--FG_COLOR);
  font-size: 0.86rem;
}

.player-profile-stats b.rate-good,
.player-profile-stats b.positive {
  color: var(--ACCENT_GREEN);
}

.player-profile-stats b.rate-mid {
  color: var(--ACCENT_YELLOW);
}

.player-profile-stats b.rate-bad {
  color: #FF6B6B;
}

.admin-user-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.admin-user-form label {
  border: 1px solid rgba(166, 186, 218, 0.16);
  border-radius: 8px;
  background: rgba(8, 13, 23, 0.32);
}

.user-admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(178, 103, 255, 0.3);
  border-radius: 999px;
  padding: 0 11px;
  color: #DCC7FF;
  background: rgba(178, 103, 255, 0.12);
  font-weight: 700;
}

.table-action {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.76rem;
  font-weight: 700;
}

.table-action.danger {
  border-color: rgba(255, 82, 98, 0.38);
  color: #ffffff;
  background: rgba(168, 29, 73, 0.82);
}

.table-action:disabled {
  cursor: default;
  opacity: 0.42;
}

.draft-row {
  display: grid;
  grid-template-columns: minmax(230px, 0.62fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    rgba(8, 13, 23, 0.32);
}

.draft-meta,
.draft-side {
  min-width: 0;
  border: 1px solid rgba(166, 186, 218, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.012);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.12);
}

.draft-side.our-side {
  border-color: rgba(166, 186, 218, 0.08);
  background: rgba(255, 255, 255, 0.012);
  box-shadow: none;
}

.draft-side.their-side {
  border-color: rgba(166, 186, 218, 0.08);
  background: rgba(255, 255, 255, 0.012);
  box-shadow: none;
}

.draft-meta strong {
  display: block;
  margin-bottom: 3px;
  color: var(--FG_COLOR);
}

.draft-meta > span {
  color: var(--FG_DIM);
  font-size: 0.78rem;
}

.draft-opponent {
  margin-bottom: 8px;
}

.draft-map-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 8px;
}

.draft-map-line img {
  width: 72px;
  height: 42px;
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 6px;
  object-fit: cover;
  background: var(--BG_INPUT);
}

.draft-map-line b,
.draft-map-line small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-map-line b {
  color: var(--FG_COLOR);
  font-size: 0.84rem;
}

.draft-map-line small {
  margin-top: 2px;
  color: var(--FG_DIM);
  font-size: 0.72rem;
  font-weight: 700;
}

.draft-match-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.draft-fact {
  display: block;
  min-width: 0;
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 6px;
  padding: 6px 7px;
  background: rgba(8, 13, 23, 0.34);
}

.draft-fact small,
.draft-fact b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-fact small {
  color: var(--FG_DIM);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
}

.draft-fact b {
  margin-top: 2px;
  color: var(--FG_COLOR);
  font-size: 0.76rem;
}

.draft-fact b.positive {
  color: var(--ACCENT_GREEN);
}

.draft-fact b.negative {
  color: #FF6B6B;
}

.draft-side-label {
  margin-bottom: 7px;
  color: var(--FG_DIM);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.our-side .draft-side-label {
  color: var(--FG_MUTED);
}

.their-side .draft-side-label {
  color: var(--FG_MUTED);
}

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

.compact-draft {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  border-radius: 8px;
  padding: 8px;
}

.our-draft.compact-draft {
  background:
    linear-gradient(90deg, rgba(29, 233, 255, 0.13), rgba(29, 233, 255, 0.035)),
    rgba(11, 17, 29, 0.62);
}

.their-draft.compact-draft {
  background:
    linear-gradient(90deg, rgba(255, 45, 111, 0.13), rgba(255, 45, 111, 0.035)),
    rgba(11, 17, 29, 0.62);
}

.draft-slot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 126px;
  overflow: hidden;
  border: 1px solid rgba(138, 159, 213, 0.58);
  border-radius: 8px;
  padding: 6px 5px 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%),
    rgba(11, 17, 29, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.compact-draft .draft-slot {
  min-height: 112px;
  padding: 5px 4px 7px;
}

.draft-slot.ban {
  border-color: rgba(255, 104, 82, 0.72);
}

.draft-slot.save {
  border-color: rgba(185, 209, 255, 0.82);
}

.draft-slot.blank {
  border-color: rgba(255, 70, 70, 0.7);
  background:
    linear-gradient(135deg, rgba(168, 29, 73, 0.24), transparent 55%),
    rgba(15, 8, 12, 0.82);
}

.draft-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: min(72px, 100%);
  height: 72px;
  overflow: hidden;
  border: 1px solid rgba(166, 186, 218, 0.5);
  border-radius: 6px;
  background: var(--BG_INPUT);
}

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

.compact-draft .draft-portrait {
  width: min(62px, 100%);
  height: 62px;
}

.draft-slot.ban .draft-portrait::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -16%;
  width: 132%;
  height: 3px;
  border-radius: 999px;
  background: #FF694F;
  box-shadow: 0 0 8px rgba(255, 105, 79, 0.72);
  transform: rotate(-45deg);
}

.draft-slot.ban::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid #FF694F;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 105, 79, 0.56);
}

.draft-slot.save::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 12px;
  height: 12px;
  border: 3px solid rgba(245, 250, 255, 0.9);
  border-radius: 50%;
  background: var(--BG_INPUT);
  box-shadow: 0 0 8px rgba(185, 209, 255, 0.62);
}

.draft-x {
  color: #FF4A4A;
  font-size: clamp(2.3rem, 4.8vw, 3.2rem);
  font-weight: 750;
  line-height: 1;
  text-shadow:
    0 0 12px rgba(255, 74, 74, 0.88),
    0 0 24px rgba(255, 74, 74, 0.36);
}

.compact-draft .draft-name,
.compact-draft .draft-type {
  font-size: 0.62rem;
}

.draft-name {
  display: -webkit-box;
  width: 100%;
  min-height: 1.8rem;
  max-width: 100%;
  overflow: hidden;
  color: var(--FG_COLOR);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
  word-break: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact-draft .draft-name {
  min-height: 1.35rem;
}

.draft-type {
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.draft-type.ban {
  color: #ffffff;
  background: var(--BUTTON_DANGER);
}

.draft-type.save {
  color: #06100b;
  background: var(--ACCENT_YELLOW);
}

.empty {
  border: 1px dashed var(--BORDER_COLOR);
  margin: 8px;
  padding: 16px;
  color: var(--FG_DIM);
  background: var(--BG_INPUT);
  text-align: center;
}

:root[data-theme="day"] body {
  background:
    radial-gradient(circle at 18% -8%, rgba(29, 140, 190, 0.12), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(178, 103, 255, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(238, 244, 251, 0) 44%),
    linear-gradient(180deg, #F8FBFF 0%, var(--BG_DARK) 52%, #EEF4FA 100%);
}

:root[data-theme="day"] body::before {
  mix-blend-mode: multiply;
}

:root[data-theme="day"] .glass-panel {
  border-color: rgba(108, 126, 152, 0.24);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.48) 48%, rgba(232, 244, 255, 0.42)),
    rgba(255, 255, 255, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(255, 255, 255, 0.36),
    0 18px 44px rgba(33, 48, 75, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

:root[data-theme="day"] .glass-panel::before {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

:root[data-theme="day"] .logo-box,
:root[data-theme="day"] .status-pill,
:root[data-theme="day"] .name-box,
:root[data-theme="day"] .formula-bar label,
:root[data-theme="day"] .summary-cell,
:root[data-theme="day"] .sheet-title,
:root[data-theme="day"] .sheet-table td,
:root[data-theme="day"] .bar-row,
:root[data-theme="day"] .rank-item,
:root[data-theme="day"] .map-item,
:root[data-theme="day"] .ban-card,
:root[data-theme="day"] .ban-graph-row,
:root[data-theme="day"] .ban-graph-panel,
:root[data-theme="day"] .player-profile-card,
:root[data-theme="day"] .draft-meta,
:root[data-theme="day"] .draft-side,
:root[data-theme="day"] .draft-slot {
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="day"] .team-cell .logo-box {
  border-color: rgba(23, 32, 51, 0.24);
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(145deg, #111A2C, #070B13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 4px 12px rgba(23, 32, 51, 0.16);
}

:root[data-theme="day"] .team-cell .logo-box img {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.48));
}

:root[data-theme="day"] .opponent-logo {
  border-color: rgba(23, 32, 51, 0.24);
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(145deg, #111A2C, #070B13);
}

:root[data-theme="day"] .opponent-logo img {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.48));
}

:root[data-theme="day"] .ban-stat {
  background: rgba(247, 249, 253, 0.82);
}

:root[data-theme="day"] .user-pill {
  color: #583E86;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 243, 248, 0.72)),
    #FFFFFF;
}

:root[data-theme="day"] button,
:root[data-theme="day"] .theme-toggle,
:root[data-theme="day"] .filter-clear,
:root[data-theme="day"] .sort-chip,
:root[data-theme="day"] .logout-button,
:root[data-theme="day"] .performance-toggle {
  border-color: rgba(108, 126, 152, 0.34);
  color: var(--FG_COLOR);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 243, 248, 0.72)),
    var(--BUTTON_GHOST);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 18px rgba(33, 48, 75, 0.08);
}

:root[data-theme="day"] button:hover,
:root[data-theme="day"] .theme-toggle:hover,
:root[data-theme="day"] .filter-clear:hover,
:root[data-theme="day"] .sort-chip:hover,
:root[data-theme="day"] .sort-chip.active {
  border-color: rgba(25, 125, 153, 0.44);
  color: var(--FG_COLOR);
  background:
    linear-gradient(180deg, rgba(234, 252, 255, 0.96), rgba(218, 242, 248, 0.8)),
    #EAF7FB;
}

:root[data-theme="day"] .vod-link {
  color: #7B1234;
  background:
    linear-gradient(180deg, rgba(255, 238, 245, 0.96), rgba(255, 211, 226, 0.86)),
    #FFF1F6;
}

:root[data-theme="day"] .player-profile-stats span {
  background: rgba(247, 249, 253, 0.86);
}

:root[data-theme="day"] .login-form label {
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="day"] .draft-fact {
  background: rgba(247, 249, 253, 0.86);
}

:root[data-theme="day"] .draft-row {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.16)),
    rgba(231, 236, 244, 0.5);
}

:root[data-theme="day"] .draft-meta,
:root[data-theme="day"] .draft-side,
:root[data-theme="day"] .sheet-panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(33, 48, 75, 0.08);
}

:root[data-theme="day"] .draft-slot.blank {
  background:
    linear-gradient(135deg, rgba(255, 70, 70, 0.2), transparent 55%),
    rgba(255, 247, 247, 0.9);
}

:root[data-theme="day"] .formula-bar,
:root[data-theme="day"] .rank-list,
:root[data-theme="day"] .map-pool,
:root[data-theme="day"] .draft-preview,
:root[data-theme="day"] .summary-strip,
:root[data-theme="day"] .cluster-grid {
  background: var(--BORDER_SUBTLE);
}

:root[data-theme="day"] .formula-bar {
  background: rgba(231, 236, 244, 0.58);
}

:root[data-theme="day"] select,
:root[data-theme="day"] input {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    var(--BG_INPUT);
}

:root[data-theme="day"] .opponent-card {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 251, 0.78) 58%, rgba(var(--team-glow), 0.13)),
    radial-gradient(circle at 8% 18%, rgba(var(--team-glow), 0.16), transparent 34%),
    rgba(255, 255, 255, 0.86);
}

:root[data-theme="day"] .opponent-card::before {
  opacity: 0.26;
}

:root[data-theme="day"] .opponent-card.team-sentinels {
  border-color: rgba(232, 19, 76, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 252, 0.84) 58%, rgba(232, 19, 76, 0.12)),
    radial-gradient(circle at 10% 24%, rgba(232, 19, 76, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.86);
}

:root[data-theme="day"] .opponent-card.team-sentinels::before {
  opacity: 0.2;
}

:root[data-theme="day"] .opponent-card.team-team-liquid-citadel::before {
  opacity: 0.24;
}

:root[data-theme="day"] .match-log-table td.draft-cell-our {
  background:
    linear-gradient(90deg, rgba(29, 140, 190, 0.16), rgba(29, 140, 190, 0.04)),
    rgba(237, 249, 252, 0.94);
}

:root[data-theme="day"] .match-log-table td.draft-cell-their {
  background:
    linear-gradient(90deg, rgba(255, 45, 111, 0.13), rgba(255, 45, 111, 0.035)),
    rgba(255, 241, 247, 0.94);
}

:root[data-theme="day"] .our-side.draft-side {
  background:
    linear-gradient(135deg, rgba(29, 140, 190, 0.22), rgba(29, 140, 190, 0.07)),
    rgba(255, 255, 255, 0.78);
}

:root[data-theme="day"] .their-side.draft-side {
  background:
    linear-gradient(135deg, rgba(255, 45, 111, 0.09), rgba(255, 45, 111, 0.025)),
    rgba(255, 255, 255, 0.78);
}

:root[data-theme="day"] .match-date,
:root[data-theme="day"] .match-mode,
:root[data-theme="day"] .match-result-stack,
:root[data-theme="day"] .score-pill {
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="day"] .sheet-panel,
:root[data-theme="day"] .cluster-grid > div {
  background: rgba(255, 255, 255, 0.64);
}

:root[data-theme="day"] .subhead,
:root[data-theme="day"] .sheet-table th {
  background: #EEF3F8;
}

:root[data-theme="day"] .sheet-table tr:nth-child(even) td {
  background: #F6F8FC;
}

:root[data-theme="day"] .sheet-nav a,
:root[data-theme="day"] .sheet-tabs a {
  border-color: rgba(108, 126, 152, 0.24);
  color: var(--FG_MUTED);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 243, 248, 0.64)),
    #FFFFFF;
}

:root[data-theme="day"] .sheet-table tr:hover td,
:root[data-theme="day"] .sheet-nav a.active,
:root[data-theme="day"] .sheet-nav a:hover,
:root[data-theme="day"] .sheet-tabs a.active,
:root[data-theme="day"] .sheet-tabs a:hover {
  color: var(--FG_COLOR);
  background: #DFF4F8;
}

:root[data-theme="day"] .sheet-tabs a.active,
:root[data-theme="day"] .sheet-tabs a:hover,
:root[data-theme="day"] .ghost-link:hover {
  color: var(--FG_COLOR);
}

@media (max-width: 1260px) {
  .formula-bar {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .name-box,
  .filter-clear {
    grid-column: auto;
  }

  .formula-bar label:first-of-type {
    grid-column: span 2;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comp-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ban-graph-grid {
    grid-template-columns: 1fr;
  }

  .span-12,
  .span-8,
  .span-6,
  .span-7,
  .span-5,
  .span-4 {
    grid-column: 1 / -1;
  }

  .cluster-grid,
  .draft-row {
    grid-template-columns: 1fr;
  }

  .match-card-main,
  .match-drafts {
    grid-template-columns: 1fr;
  }

  .match-result-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .workbook-shell {
    padding: 8px;
  }

  .app-header,
  .header-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .header-actions {
    display: grid;
  }

  .status-pill {
    min-width: 0;
  }

  .formula-bar,
  .workbook-grid,
  .workbook-grid.full-log-grid,
  .summary-strip,
  .comp-insight-grid,
  .ban-graph-grid,
  .ban-graph-row {
    grid-template-columns: 1fr;
  }

  .app-header,
  .formula-bar,
  .sheet-nav {
    position: static;
  }

  .sheet-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-tabs {
    overflow-x: visible;
  }

  .bar-row,
  .compact .bar-row,
  .map-item {
    grid-template-columns: 1fr;
  }

  .draft-line,
  .compact-draft {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .bar-value {
    text-align: left;
  }
}
