/* Brawlers' Guild: a flat dark page. Hairlines, system type, numbers in
   mono. Colour only where it says something: green for won, red for lost,
   amber for where you are. The art is the banner and the icons. */
:root {
  --bg: #0b0b0c;
  --raise: #131315;
  --line: #222226;
  --line-strong: #37373d;
  --text: #cfccc5;
  --dim: #8a8780;
  --bright: #f3f0e9;
  --accent: #e5a63c;
  --win: #62c07a;
  --loss: #e26f61;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding-top: 14px; padding-bottom: 40px; outline: none; }
a { color: var(--bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--bg); padding: 6px 10px; z-index: 5; }
code, kbd { font-family: var(--mono); font-size: 0.93em; color: var(--bright); }
kbd { border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; }
.dim { color: var(--dim); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.win { color: var(--win); }
.loss { color: var(--loss); }
[hidden] { display: none !important; }
.narrow { display: none; }

/* The top: the scene, then one bar with the name, the pages and the faction. */
.top { border-bottom: 1px solid var(--line); }
.banner { display: block; width: 100%; height: clamp(56px, 10vw, 112px); object-fit: cover; object-position: 72% 50%; }
.bar { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; row-gap: 2px; padding: 8px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; color: var(--bright); padding-bottom: 8px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.pages { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pages::-webkit-scrollbar { display: none; }
.pages a, .tabs a { color: var(--dim); padding: 6px 10px 8px; border-bottom: 2px solid transparent; white-space: nowrap; }
.pages a:hover, .tabs a:hover { color: var(--bright); text-decoration: none; }
.pages a[aria-current], .tabs a[aria-current] { color: var(--bright); border-bottom-color: var(--accent); }
.sides { display: flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; margin-bottom: 8px; font-size: 13px; }
.sides a { padding: 3px 10px; color: var(--dim); }
.sides a + a { border-left: 1px solid var(--line-strong); }
.sides a:hover { color: var(--bright); text-decoration: none; }
.sides a[aria-current] { background: var(--raise); color: var(--bright); }

h1 { font-size: 20px; font-weight: 650; color: var(--bright); margin: 6px 0 2px; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 650; color: var(--bright); margin: 26px 0 6px; }
p { margin: 6px 0; }
.lead, .prose p, .prose li { max-width: 72ch; }
ul, ol { margin: 6px 0; padding-left: 20px; }
li { margin: 4px 0; }
li b { color: var(--bright); font-weight: 600; }
button { font: inherit; color: var(--bright); background: var(--raise); border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 12px; cursor: pointer; }
button:hover { border-color: var(--dim); }

/* One line saying where things stand. */
.strip { display: flex; flex-wrap: wrap; gap: 2px 18px; color: var(--dim); font-size: 13px; margin: 2px 0 10px; }
.strip b { color: var(--bright); font-weight: 600; }
.strip a { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.strip a:hover { color: var(--bright); }

/* Tabs with the search beside them. */
.tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; margin-bottom: -1px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .count { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-left: 5px; }
.find { margin-bottom: 6px; }
input[type="search"] { font: inherit; color: var(--bright); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 9px; width: 210px; max-width: 100%; }
input[type="search"]::placeholder { color: var(--dim); }
input[type="search"]:focus { outline: none; border-color: var(--accent); }

/* Tables: tight rows, hairlines, numbers to the right. */
.scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 500; font-size: 12px; color: var(--dim); padding: 7px 8px 5px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.grid td { padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.grid tbody tr:hover { background: var(--raise); }
.grid th.num, .grid td.num { text-align: right; width: 1%; padding-left: 20px; }
.grid td.num { color: var(--bright); }
.grid td.num.dim { color: var(--dim); }
.grid td.num.win { color: var(--win); }
.grid td.num.loss { color: var(--loss); }
.grid td.place { color: var(--dim); }
.grid .place { padding-left: 8px; }
.grid .hug { width: 1%; padding-right: 22px; }
.grid td.wrapping { white-space: normal; }
.grid .name { font-weight: 550; }
.badge { width: 22px; height: 22px; vertical-align: -6px; margin-right: 6px; }
.icon { width: 16px; height: 16px; vertical-align: -3px; }
.rank { color: var(--text); }
.tag { display: inline-block; font-size: 12px; line-height: 1; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 5px; vertical-align: 1px; margin-left: 6px; }
.tag.death { color: var(--loss); border-color: #5a2f2a; }
.tag.warn { color: var(--accent); border-color: #5c4520; }
.note { color: var(--dim); font-size: 13px; margin: 12px 0; max-width: 80ch; }
.empty { color: var(--dim); padding: 28px 0; border-bottom: 1px solid var(--line); }
.more { margin: 10px 0; font-size: 13px; color: var(--dim); }
.more a { margin-right: 12px; }

/* A fighter's page. */
.who { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.who img { width: 56px; height: 56px; flex: none; }
.who h1 { margin: 0; }
.who .line { color: var(--dim); }
.who .line b { color: var(--bright); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 4px; margin: 8px 0; }
.facts div { padding: 8px 14px; border-right: 1px solid var(--line); flex: 1 1 110px; }
.facts div:last-child { border-right: 0; }
.facts dt { color: var(--dim); font-size: 12px; }
.facts dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--bright); font-size: 16px; }
dl.facts { margin: 8px 0; }

/* The ranks, on the rules page. */
.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 4px; max-width: 72ch; margin: 10px 0; }
.ranks div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.ranks img { width: 30px; height: 30px; }
.ranks span { display: block; line-height: 1.25; white-space: nowrap; }
.ranks .num { color: var(--dim); font-size: 12px; }

.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.downloads a, .downloads span { border: 1px solid var(--line-strong); border-radius: 4px; padding: 7px 14px; }
.downloads a { background: var(--raise); }
.downloads a:hover { border-color: var(--accent); text-decoration: none; }
.downloads span { color: var(--dim); }
.commands td:first-child { width: 1%; }
.commands td { white-space: normal; }
.commands td:first-child { white-space: nowrap; }

.foot { border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; padding: 12px 0 20px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }

/* Phones: the columns that can wait are left out, and the rows tighten. */
@media (max-width: 640px) {
  .wide { display: none; }
  .wrap { padding: 0 12px; }
  .bar { column-gap: 12px; }
  .brand { flex: 1 1 auto; }
  .pages { order: 3; flex-basis: 100%; margin: 0 -12px; padding: 0 6px; }
  .pages a { padding: 6px 7px 8px; }
  .grid th, .grid td { padding-left: 5px; padding-right: 5px; }
  .grid th.num, .grid td.num { padding-left: 9px; }
  .grid .hug { padding-right: 8px; }
  .badge { margin-right: 0; }
  .narrow { display: inline; }
  .grid th:first-child, .grid td:first-child { padding-left: 0; }
  .grid th:last-child, .grid td:last-child { padding-right: 0; }
  .find, input[type="search"] { width: 100%; }
  .tools { border-bottom: 0; }
  .tabs { border-bottom: 1px solid var(--line); width: 100%; margin-bottom: 0; }
  .tabs a { padding: 6px 8px 8px; }
  .who img { width: 44px; height: 44px; }
  .foot span:first-child { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Fights: one row each on a wide page, two lines each on a phone. */
.fights, .nights { list-style: none; margin: 0; padding: 0; }
.fight { display: grid; grid-template-columns: 72px minmax(0, 1fr) 36px minmax(0, 1fr) 64px minmax(0, 1.1fr); column-gap: 14px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.fight:hover { background: var(--raise); }
.fight .main, .fight .meta { display: contents; }
.fight .main > *, .fight .meta > * { grid-row: 1; min-width: 0; }
.fight .when { grid-column: 1; }
.fight .a { grid-column: 2; }
.fight .verb { grid-column: 3; text-align: center; }
.fight .b { grid-column: 4; }
.fight .br { grid-column: 5; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.fight .tags { grid-column: 6; }
.fight .a, .fight .b { display: flex; justify-content: space-between; gap: 10px; }
.fight .a a, .fight .b a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fight .tags .tag:first-child { margin-left: 0; }
.fight.head { color: var(--dim); font-size: 12px; border-bottom-color: var(--line-strong); padding-top: 7px; }
.fight.head:hover { background: none; }
.tag { font-weight: 400; }

.night { padding: 9px 0; border-bottom: 1px solid var(--line); }
.night .title { color: var(--bright); font-weight: 600; }
.night .title .tag:first-child { margin-left: 8px; }
.seasons td:first-child { width: 1%; padding-right: 28px; }

/* A night's bracket: a column a round, each match two lines beside a rule;
   a round's matches sit midway between the two that feed each. */
.bracket { display: flex; gap: 0 22px; margin: 8px 0 2px; max-width: 880px; }
.round { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.round .label { font-size: 12px; padding-bottom: 4px; }
.matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.match { border-left: 2px solid var(--line-strong); padding: 1px 0 1px 8px; line-height: 1.35; }
.match div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match a { color: var(--text); font-weight: 400; }
.match .won a { color: var(--bright); font-weight: 600; }
.match .out a { color: var(--dim); }

@media (max-width: 640px) {
  .fight { display: block; padding: 6px 0; }
  .fight .main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .fight .a, .fight .b { display: inline-flex; justify-content: flex-start; gap: 6px; }
  .fight .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; font-size: 12px; }
  .fight .br { text-align: left; }
  .fight.head { display: none; }
  /* A bracket's rounds stack, first round on top. */
  .bracket { display: block; }
  .round { margin-top: 8px; }
  .matches { gap: 6px; }
}
