@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap");

* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --hltv-black: #000000;
  --hltv-page: #1b1f23;
  --hltv-box: #2d3844;
  --hltv-box-2: #364250;
  --hltv-box-3: #2a3540;
  --hltv-row: #2f3b47;
  --hltv-row-alt: #2a3642;
  --hltv-row-hover: #3a4856;
  --hltv-border: #1b2129;
  --hltv-inset: #1b2129;
  --hltv-text: #929a9e;
  --hltv-text-strong: #ffffff;
  --hltv-text-muted: #6b737a;
  --hltv-link: #a9b4c0;
  --hltv-blue: #2e6eb5;
  --hltv-blue-dark: #1e4f86;
  --hltv-on-blue: #ffffff;
  --hltv-won: #09c100;
  --hltv-lost: #8b939a;
  --hltv-out: #4a545e;
  --hltv-out-bg: #323a42;
  --hltv-header-grad-top: #3a4a5a;
  --hltv-footer-bg: #12161a;
  --hltv-footer-text: #6b737a;
  --hltv-feeder: #4a5561;
  --hltv-dash: #3d4854;
  --content-max: 1360px;
  --left-w: 168px;
  --right-w: 220px;
  --font: "Open Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --hltv-black: #d6dde5;
    --hltv-page: #e8eef4;
    --hltv-box: #ffffff;
    --hltv-box-2: #eef3f8;
    --hltv-box-3: #f5f8fb;
    --hltv-row: #ffffff;
    --hltv-row-alt: #f4f7fa;
    --hltv-row-hover: #e6eef6;
    --hltv-border: #d4dde6;
    --hltv-inset: #e8eef4;
    --hltv-text: #5a6570;
    --hltv-text-strong: #1b242d;
    --hltv-text-muted: #7a8692;
    --hltv-link: #3a6ea8;
    --hltv-blue: #2e6eb5;
    --hltv-blue-dark: #1e4f86;
    --hltv-on-blue: #ffffff;
    --hltv-won: #0a9a08;
    --hltv-lost: #8a949e;
    --hltv-out: #9aa3ab;
    --hltv-out-bg: #e6ebf0;
    --hltv-header-grad-top: #d9e4ef;
    --hltv-footer-bg: #dfe6ed;
    --hltv-footer-text: #6b7784;
    --hltv-feeder: #9aa5b1;
    --hltv-dash: #c5d0db;
  }
}

html, body {
  margin: 0;
  background: var(--hltv-black);
  color: var(--hltv-text);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.4;
}

a { color: var(--hltv-link); text-decoration: none; }
a:hover { color: var(--hltv-text-strong); text-decoration: underline; }

.hltv-navbar {
  background: var(--hltv-box);
  height: 40px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--hltv-border);
}
.hltv-navbar-inner {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: stretch;
  padding: 0 8px;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hltv-text-strong);
  font-weight: 700;
  padding: 0 8px;
}
.brand small { display: block; color: var(--hltv-text-muted); font-size: 10px; font-weight: 600; }
.hltv-nav-links { display: flex; align-items: stretch; margin-left: auto; }
.hltv-nav-links a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--hltv-text);
  font-weight: 700;
  font-size: 13px;
}
.hltv-nav-links a:hover { background: var(--hltv-row-hover); color: var(--hltv-text-strong); text-decoration: none; }

.hltv-width {
  width: min(var(--content-max), calc(100% - 16px));
  margin: 8px auto 32px;
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.hltv-width.detail { grid-template-columns: minmax(0, 1fr) var(--right-w); }

.standard-box { background: var(--hltv-box); margin-bottom: 8px; }
.box-headline {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--hltv-text-strong);
  background: var(--hltv-box-2);
  border-bottom: 1px solid var(--hltv-border);
}
.box-body { padding: 10px; }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--hltv-border);
}
.sidebar-list li:last-child { border-bottom: 0; }
.sidebar-list strong { color: var(--hltv-text-strong); }
.quick-links { display: flex; flex-direction: column; }
.quick-links button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--hltv-border);
  background: transparent;
  color: var(--hltv-link);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 7px 10px;
  cursor: pointer;
}
.quick-links button:hover,
.quick-links button.is-on { background: var(--hltv-row-hover); color: var(--hltv-text-strong); }

.event-header {
  background: linear-gradient(180deg, var(--hltv-header-grad-top), var(--hltv-box));
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px;
  align-items: center;
  margin-bottom: 8px;
}
.event-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: var(--hltv-inset);
  color: var(--hltv-text-strong);
  font-weight: 700;
  font-size: 22px;
}
.event-header h1 { margin: 0 0 6px; color: var(--hltv-text-strong); font-size: 20px; }
.event-header-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.event-header-meta strong { color: var(--hltv-text-strong); }

.event-tabs {
  display: flex;
  flex-wrap: wrap;
  background: var(--hltv-box);
  margin-bottom: 8px;
  border-bottom: 2px solid var(--hltv-blue);
}
.event-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--hltv-text);
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
}
.event-tab:hover { color: var(--hltv-text-strong); background: rgba(255, 255, 255, 0.04); }
.event-tab.is-active { background: var(--hltv-blue); color: var(--hltv-on-blue); }
.panel { display: none; }
.panel.is-active { display: block; }
.prose { font-size: 13px; line-height: 1.65; }
.prose p { margin: 0 0 8px; }

.size-switch { display: flex; gap: 0; margin-bottom: 8px; }
.size-switch button {
  appearance: none;
  border: 1px solid var(--hltv-border);
  border-right: 0;
  background: var(--hltv-box);
  color: var(--hltv-text);
  font: inherit;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}
.size-switch button:last-child { border-right: 1px solid var(--hltv-border); }
.size-switch button.is-active { background: var(--hltv-blue); color: white; border-color: var(--hltv-blue-dark); }

.logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: var(--hltv-inset);
  color: var(--hltv-text-strong);
  font-size: 8px;
  font-weight: 700;
  border-radius: 50%;
  overflow: hidden;
}
.logo-fallback img { width: 100%; height: 100%; object-fit: cover; }

.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seat {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid var(--hltv-border);
  background: var(--hltv-row);
}
.seat:nth-child(even) { background: var(--hltv-row-alt); }
.seat .name { color: var(--hltv-text-strong); font-weight: 700; }
.seat .sub { color: var(--hltv-text-muted); font-size: 11px; }
.rank { text-align: right; font-weight: 700; color: var(--hltv-text); }
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  background: var(--hltv-box-3);
  color: var(--hltv-text);
}
.badge.go { color: var(--hltv-won); }
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--hltv-border);
}
.person {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--hltv-row);
  color: inherit;
}
.person-main {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}
.person-main:hover { text-decoration: none; color: var(--hltv-text-strong); }
.person .logo-fallback { width: 36px; height: 36px; font-size: 10px; }
.person .name { color: var(--hltv-text-strong); font-weight: 700; }
.bio {
  min-height: 2.4em;
  color: var(--hltv-text);
  font-size: 11px;
  line-height: 1.45;
}
.bio p { margin: 0 0 4px; }
.seat .logo-fallback { width: 28px; height: 28px; font-size: 10px; }

.profile-grid { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 12px; }
.illu {
  height: 280px;
  background: var(--hltv-inset);
  border: 1px dashed var(--hltv-dash);
  display: grid;
  place-items: center;
  color: var(--hltv-text-muted);
  font-weight: 700;
  overflow: hidden;
}
.illu img { width: 100%; height: 100%; object-fit: cover; }
.illu.is-from-avatar img {
  width: 42%;
  height: auto;
  max-height: 62%;
  object-fit: contain;
  border-radius: 50%;
}
.illu.is-empty { font-size: 28px; letter-spacing: 0.04em; }
.profile-avatar { width: 48px; height: 48px; font-size: 14px; margin-bottom: 8px; }
.profile-grid h1 { margin: 0 0 4px; color: var(--hltv-text-strong); font-size: 20px; }
.tl {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--hltv-border);
  color: var(--hltv-text-strong);
  font-weight: 700;
}

/* Dual single-elim, same cards as BHML */
.se-bracket-wrap { overflow-x: auto; padding-bottom: 6px; }
.dual-bracket { display: flex; align-items: stretch; width: max-content; min-width: 100%; }
.se-bracket {
  --se-slot-min: 74px;
  --se-slot-gap: 8px;
  --se-rounds-max: 1;
  display: flex;
  align-items: stretch;
}
.se-bracket.has-triple { --se-slot-min: 100px; }
.dual-right { flex-direction: row-reverse; }
.se-round {
  display: flex;
  flex-direction: column;
  width: 200px;
  min-width: 200px;
  flex: 0 0 200px;
}
.se-round-title {
  text-align: center;
  color: var(--hltv-text-strong);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 4px 6px;
  border-bottom: 1px solid var(--hltv-border);
  margin-bottom: 4px;
}
.se-round-matches {
  --se-feeder: var(--hltv-feeder);
  --se-feeder-arm: 10px;
  --se-feeder-arm-in: 0px;
  display: grid;
  gap: var(--se-slot-gap);
  align-content: start;
  flex: 1 1 auto;
  min-height: calc((var(--se-rounds-max) * var(--se-slot-min)) + ((var(--se-rounds-max) - 1) * var(--se-slot-gap)));
  padding: 4px 10px;
  position: relative;
}
.se-match-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: visible;
}
.bracket-match {
  display: block;
  width: 180px;
  background: var(--hltv-row);
  border: 1px solid var(--hltv-border);
  color: inherit;
  position: relative;
  z-index: 1;
}
.bracket-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 5px 6px;
  border-top: 1px solid var(--hltv-border);
  min-height: 26px;
}
.bracket-team:first-child { border-top: 0; }
.bracket-team-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bracket-team-side .name {
  color: var(--hltv-text-strong);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bracket-team-side .name.is-placeholder { color: var(--hltv-text); font-weight: 600; font-size: 11px; }
.bracket-score { font-weight: 700; color: var(--hltv-text); font-variant-numeric: tabular-nums; }
.bracket-team.won { box-shadow: inset 2px 0 0 var(--hltv-won); }
.bracket-team.won .bracket-score { color: var(--hltv-won); }
.bracket-team.is-out {
  background: var(--hltv-out-bg);
  box-shadow: inset 2px 0 0 var(--hltv-out);
}
.bracket-team.is-out .name,
.bracket-team.is-out .bracket-score,
.bracket-team.is-out .logo-fallback { color: var(--hltv-lost); }
.bracket-team.is-out .logo-fallback { filter: grayscale(1); opacity: 0.7; }

.se-round[data-feed="merge"] .se-match-slot::before,
.se-round[data-feed="pass"] .se-match-slot::before,
.se-round[data-feed="merge"] .se-match-slot[data-pair="top"]::after,
.se-round:not(:first-child) .se-match-slot > .bracket-match::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.se-round[data-feed="merge"] .se-match-slot::before,
.se-round[data-feed="pass"] .se-match-slot::before {
  right: calc(-1 * var(--se-feeder-arm));
  top: 50%;
  width: var(--se-feeder-arm);
  height: 2px;
  background: var(--se-feeder);
  transform: translateY(-50%);
}
.se-round[data-feed="merge"] .se-match-slot[data-pair="top"]::after {
  right: calc(-1 * var(--se-feeder-arm));
  top: 50%;
  width: var(--se-feeder-arm);
  height: calc(100% + var(--se-slot-gap));
  border-right: 2px solid var(--se-feeder);
}
.se-round:not(:first-child) .se-match-slot > .bracket-match::before {
  left: calc(-1 * var(--se-feeder-arm-in));
  top: 50%;
  width: var(--se-feeder-arm-in);
  height: 2px;
  background: var(--se-feeder);
  transform: translateY(-50%);
}
.dual-right .se-round[data-feed="merge"] .se-match-slot::before,
.dual-right .se-round[data-feed="pass"] .se-match-slot::before {
  right: auto;
  left: calc(-1 * var(--se-feeder-arm));
}
.dual-right .se-round[data-feed="merge"] .se-match-slot[data-pair="top"]::after {
  right: auto;
  left: calc(-1 * var(--se-feeder-arm));
  border-right: 0;
  border-left: 2px solid var(--se-feeder);
}
.dual-right .se-round:not(:first-child) .se-match-slot > .bracket-match::before {
  left: auto;
  right: calc(-1 * var(--se-feeder-arm-in));
}

.site-footer {
  background: var(--hltv-footer-bg);
  color: var(--hltv-footer-text);
  text-align: center;
  padding: 14px;
}

@media (max-width: 980px) {
  .hltv-width, .hltv-width.detail { grid-template-columns: 1fr; }
  .group-grid, .profile-grid { grid-template-columns: 1fr; }
}
