/* challs.gg */
:root {
  --bg: #0A0E14; --panel: #121821; --panel2: #0F141C; --line: #263042; --line2: #222B3B; --line3: #3A4760;
  --text: #E8EEF5; --soft: #C9D3E0; --muted: #93A1B5; --accent: #5CC8FF; --green: #3DDC84; --red: #FF5C5C;
  --amber: #FFB547; --purple: #C3B5FF; --blurple: #5865F2;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #9BDDFF; }
h1, h2, h3, .display { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; line-height: 1.05; margin: 0; }
h1 { font-size: 52px; }
h2 { font-size: 26px; margin-bottom: 12px; }
h3 { font-size: 22px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 13px; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 36px; padding-bottom: 64px; }
.lead { color: var(--muted); font-size: 17px; margin: 10px 0 24px; max-width: 760px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); min-height: 44px; }
.logo span { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: .04em; }
.logo b { color: var(--accent); font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.nav a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); background: #1A2230; }
.nav a.admin { color: var(--amber); }
.me { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--soft); }
.bell:hover { background: #1A2230; color: var(--text); }
.bell .count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: #1A1204; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.me-av { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line3); object-fit: cover; display: block; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer .wrap { padding-top: 22px; padding-bottom: 22px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* Flash messages */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.flash.success { background: #0E2A1C; border-color: #1F6B45; color: #BFF5D7; }
.flash.error { background: #2A1414; border-color: #7A2E2E; color: #FFD0D0; }
.flash.info { background: #0F2A38; border-color: #1F5B78; color: #CFEFFF; }
.banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; background: #1F1808; border: 1px solid var(--amber); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; color: var(--text); }
.banner strong { color: var(--amber); }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.inset { background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.cols > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.cols > .side { flex: 1 1 320px; min-width: 0; }
.cols > .side:not(:has(*)) { display: none; }
.grid { align-items: start; }
section { min-width: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line3); background: transparent; color: var(--text); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #56657F; color: var(--text); }
.btn.go { border: 1.5px solid var(--green); color: var(--green); background: var(--bg); font-weight: 700; }
.btn.go:hover { background: #0E2A1C; color: var(--green); }
.btn.warn { border: 1.5px solid var(--amber); color: var(--amber); }
.btn.danger { border: 1.5px solid var(--red); color: var(--red); }
.btn.discord { background: var(--blurple); border-color: var(--blurple); color: #fff; font-weight: 700; }
.btn.discord:hover { background: #4752C4; color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; min-height: 50px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--accent); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
form.inline { display: inline; margin: 0; }

/* Forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
label.field .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select, textarea {
  min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line3); background: var(--bg); color: var(--text); font: 500 15px Inter, system-ui, sans-serif; width: 100%;
}
textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.lineup { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.lineup label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--soft); }
.lineup label span { width: 34px; flex: none; }
.lineup select { min-height: 40px; }

/* Tabs and pills */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tab { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.tab.on { background: var(--accent); color: #04121C; }
.tab:hover:not(.on) { color: var(--text); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #1A2230; color: var(--soft); vertical-align: 2px; white-space: nowrap; }
.pill.lv { background: #2A2347; color: var(--purple); }
.pill.cap { background: #3A2A10; color: var(--amber); }
.pill.blue { background: #0F2A38; color: var(--accent); }
.pill.green { background: #0E2A1C; color: var(--green); }
.pill.red { background: #2A1414; color: var(--red); }
.pill.retired { border: 1px solid var(--line3); color: var(--text); }
.badge { width: 44px; height: 44px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #1A2230; border: 1px solid var(--line3); color: var(--soft); font-size: 13px; font-weight: 700; }
.badge.big { width: 64px; height: 64px; border-radius: 14px; font-size: 18px; }
.badge.win { background: #0E2A1C; border: 1.5px solid var(--green); color: var(--green); }
.av { border-radius: 50%; object-fit: cover; background: #1A2230; flex: none; vertical-align: middle; }
.pchip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pchip a { color: var(--text); font-weight: 600; }

/* Cards on the boards */
.card { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card.now { border-color: var(--green); }
.card.alert { border-color: var(--amber); }
.card .grow { flex: 1 1 220px; min-width: 0; }
.when { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--amber); }
.card.now .when { color: var(--green); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(61,220,132,.2); }
details.expand { flex: 1 1 100%; }
details.expand > summary { list-style: none; display: inline-flex; }
details.expand > summary::-webkit-details-marker { display: none; }
details.expand[open] > summary { display: none; }
.card details.expand:not([open]) { flex: 0 0 auto; }
.expand-body { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.empty { border: 1px dashed var(--line3); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--panel2); color: var(--soft); border: 1px solid var(--line2); }
.chip strong { color: var(--text); }
.chip.sub { background: transparent; border-style: dashed; border-color: var(--line3); }
.chip.in { border-color: var(--amber); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
table.board { width: 100%; border-collapse: collapse; min-width: 640px; }
table.board th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 10px; border-bottom: 1px solid var(--line); }
table.board td { padding: 11px 10px; border-bottom: 1px solid #1C2433; }
table.board tr:last-child td { border-bottom: 0; }
table.board .num { text-align: right; }
table.board th:first-child, table.board td:first-child { padding-left: 18px; }
table.board th:last-child, table.board td:last-child { padding-right: 18px; }
.rank { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 20px; white-space: nowrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border-radius: 12px; padding: 12px 14px; }
.stat .big { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 30px; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kicker { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.progress { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; border-radius: 6px; background: var(--purple); }

/* Match page */
.versus { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px 40px; }
.versus .side { flex: 1 1 260px; display: flex; align-items: center; gap: 14px; }
.versus .side.home { justify-content: flex-end; text-align: right; }
.versus .tname { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 34px; line-height: 1; text-transform: uppercase; color: var(--text); }
.vs { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 32px; color: var(--muted); }
.lrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; background: var(--panel2); border: 1px solid var(--line2); }
.lrow.sub { background: transparent; border-style: dashed; border-color: var(--line3); }
.lrow.out { opacity: .6; border-style: dashed; background: transparent; }
.lrow .pos { width: 34px; flex: none; color: var(--text); }
.chat { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; background: var(--panel); border: 1.5px solid var(--blurple); border-radius: 16px; padding: 16px 20px; }
.chat.closed { border: 1px dashed var(--line3); color: var(--muted); }
.timeline { margin: 0; padding-left: 18px; color: var(--soft); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

/* Profile */
.trophy { position: relative; width: 60px; height: 60px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 2px solid currentColor; }
.trophy .tip { display: none; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; background: var(--panel); border: 1px solid currentColor; border-radius: 12px; padding: 10px 14px; z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,.5); text-align: left; }
.trophy:hover .tip, .trophy:focus .tip { display: block; }
.trophy .tip b { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; text-transform: uppercase; display: block; }
.trophy .tip span { color: var(--text); display: block; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tile.retired { border-style: dashed; opacity: .88; }
.tile .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (max-width: 640px) {
  h1 { font-size: 40px; }
  .versus .side.home { justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
  .nav a { padding: 8px 9px; }
}
