@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url('/fonts/barlow/barlow-condensed-latin-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --bg: #f5f5f1;
  --surface: #fff;
  --surface-alt: #eeeeea;
  --ink: #171922;
  --muted: #505560;
  --line: #d6d9df;
  --accent: #5940ca;
  --accent-soft: #efebff;
  --red: #b5243e;
  --red-soft: #fff0f1;
  --green: #18613f;
  --green-soft: #e6f5eb;
  --gold: #795119;
  --gold-soft: #fff0d3;
  --on-accent: #fff;
  --heading: Barlow, 'Arial Narrow', sans-serif;
  font-family: Manrope, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101117;
    --surface: #171a23;
    --surface-alt: #1e222e;
    --ink: #f5f5f8;
    --muted: #b9becc;
    --line: #343947;
    --accent: #b7a6ff;
    --accent-soft: #2a2247;
    --red: #ff8697;
    --red-soft: #3b202b;
    --green: #79e8ab;
    --green-soft: #1a362d;
    --gold: #ffcb72;
    --gold-soft: #352a1c;
    --on-accent: #16111f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100dvh; display: flex; flex-direction: column; }
body.valorant, .pool.valorant { --accent: var(--red); --accent-soft: var(--red-soft); }
body.minecraft, .pool.minecraft { --accent: var(--green); --accent-soft: var(--green-soft); }
a { color: inherit; }
img { display: block; width: 100%; height: auto; }
.wrap { width: min(100% - 2rem, 1220px); margin-inline: auto; }
.skip { position: fixed; left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .7rem; transform: translateY(-200%); }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
main:focus { outline: none; }
.header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 65px; gap: .45rem 1rem; padding-block: .55rem; }
.brand { font: 800 1.65rem/1 var(--heading); letter-spacing: .03em; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.brand > span:last-child { color: var(--accent); margin-left: .17em; }
.brand-mark { width: 23px; height: 23px; margin-right: .55rem; display: flex; align-items: center; gap: 3px; transform: skew(-19deg); }
.brand-mark i { width: 5px; height: 65%; background: var(--accent); }
.brand-mark i:nth-child(2) { height: 100%; }
nav { display: flex; align-items: center; justify-content: end; gap: clamp(.65rem, 2vw, 1.4rem); font-size: .84rem; font-weight: 750; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover, nav a[aria-current] { color: var(--ink); }
.admin-link { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); padding: .54rem .62rem; border-radius: 6px; }
.lock { position: relative; display: inline-block; width: 11px; height: 9px; border: 1.4px solid currentColor; border-radius: 2px; margin-top: 4px; }
.lock::before { content: ''; position: absolute; width: 5px; height: 6px; border: 1.4px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; left: 1.5px; bottom: 6px; }

#main { flex: 1; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { font: 800 clamp(3rem, 8vw, 6.6rem)/.91 var(--heading); text-transform: uppercase; }
h2 { font: 800 clamp(1.9rem, 4vw, 3rem)/1 var(--heading); text-transform: uppercase; }
h3 { font-size: 1.25rem; line-height: 1.2; }
.eyebrow { color: var(--accent); font-size: .76rem; line-height: 1.4; letter-spacing: .15em; font-weight: 800; }
.eyebrow i { display: inline-block; width: 9px; height: 9px; margin-right: .35rem; background: currentColor; }
.home-intro { padding: clamp(2.8rem, 6vw, 5.2rem) 0 clamp(1.8rem, 4vw, 2.5rem); }
.home-intro h1 { font-size: clamp(4.1rem, 12vw, 9rem); margin: .3rem 0 .8rem; letter-spacing: -.023em; }
.home-intro em { font-style: normal; -webkit-text-stroke: 1.5px var(--ink); color: transparent; }
.home-intro h1 span { color: var(--accent); }
.lede { color: var(--muted); max-width: 32rem; line-height: 1.6; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.game-card { --card: #ff7487; position: relative; isolation: isolate; display: flex; align-items: end; overflow: hidden; min-height: 315px; background: #141b2b; color: #fff; border-radius: 12px; border-bottom: 4px solid var(--card); text-decoration: none; }
.game-card.minecraft { --card: #9bf18f; }
.game-card img, .tournament-hero img { position: absolute; inset: 0; height: 100%; object-fit: cover; z-index: -2; }
.game-card img { object-position: 50% 48%; transition: transform .45s ease; }
.game-card:hover img, .game-card:focus-visible img { transform: scale(1.045); }
.game-card::after, .tournament-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; }
.game-card::after { background: linear-gradient(180deg, transparent 19%, #08101d52 46%, #090e19ee 84%, #090e19 100%); }
.game-card-info { padding: 1.15rem; width: 100%; }
.card-format { color: var(--card); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; }
.game-card h2 { font-size: clamp(3.05rem, 6.1vw, 5.4rem); line-height: .9; margin: .3rem 0 .4rem; }
.bedwars { color: #e3f3e6; font-size: .89rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .8rem; color: #e3e7ef; font-size: .88rem; }
.card-action { display: grid; place-items: center; padding-inline: .7rem; height: 34px; background: var(--card); border-radius: 6px; color: #151525; font-size: .8rem; font-weight: 800; }
.footer { margin-top: 2.3rem; border-top: 1px solid var(--line); padding: 1rem 0; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .78rem; }
.footer strong { color: var(--ink); letter-spacing: .1em; }

.install { margin-top: .8rem; padding: .7rem; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .55rem .7rem; align-items: center; }
.install[hidden] { display: none; }
.install img { border-radius: 8px; }
.install h2 { font: 800 1rem/1.25 Manrope, system-ui, sans-serif; text-transform: none; }
.install p { color: var(--muted); font-size: .83rem; margin-top: .15rem; }
.install-actions { display: flex; flex-wrap: wrap; gap: .4rem; grid-column: 1 / -1; }
.install-actions button { min-height: 2.35rem; font-size: .82rem; }
#install-instructions { grid-column: 1 / -1; padding: .6rem; background: var(--surface-alt); border-radius: 5px; }
#install-entry { min-height: auto; background: transparent; border: 0; padding: 0; color: var(--muted); font-size: inherit; text-decoration: underline; }
.footer { flex-wrap: wrap; }
@media (min-width: 740px) {
  .install { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .install-actions { grid-column: auto; }
}

.tournament-hero { --hero: #ffabb3; position: relative; isolation: isolate; display: flex; align-items: end; min-height: clamp(195px, 34vw, 315px); padding: clamp(1rem, 4vw, 2.5rem); margin-top: 1.25rem; border-radius: 12px; overflow: hidden; background: #111b2e; color: #fff; }
.tournament-hero.minecraft { --hero: #aeff9b; }
.tournament-hero img { object-position: 50% 47%; }
.tournament-hero::after { background: linear-gradient(90deg, #080f1df0, #080f1d42 83%), linear-gradient(0deg, #080f1dd1, transparent 65%); }
.tournament-hero .eyebrow { color: var(--hero); }
.tournament-hero h1 { margin: .25rem 0 .5rem; }
.tournament-hero p:last-child { color: #e8ecf1; }
.section-header { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .5rem 1rem; margin: 1.65rem 0 .9rem; }
.connection { display: inline-flex; gap: .45rem; align-items: center; color: var(--muted); font-size: .82rem; padding-block: .25rem; }
.connection i, .pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.connection.online { color: var(--green); }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-width: 0; }
.pool { margin-bottom: 1rem; overflow: hidden; position: relative; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; padding: .95rem; }
.panel-heading .eyebrow { margin-bottom: .28rem; }
.active-pool { border-color: var(--accent); }
.active-pool::before { position: absolute; content: ''; top: 0; left: 0; width: 30%; height: 3px; background: var(--accent); animation: scan 2.8s ease-in-out infinite alternate; }
body.minecraft .active-pool::before { width: 34%; background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 17px); animation-timing-function: steps(12); }
@keyframes scan { to { transform: translateX(195%); opacity: .48; } }
.pill { display: inline-flex; align-items: center; gap: .4rem; border-radius: 4px; padding: .35rem .55rem; background: var(--surface-alt); color: var(--muted); font-size: .75rem; font-weight: 800; }
.pill.live { background: var(--accent-soft); color: var(--accent); }
.pill.live i { animation: pulse 1.7s ease-in-out infinite alternate; }
body.minecraft .pill.live i { border-radius: 0; }
@keyframes pulse { to { opacity: .45; } }
.rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(5rem, 100%), 1fr)); gap: .42rem; padding: 0 .95rem; margin: 0 0 .8rem; list-style: none; }
.rounds li { display: grid; align-content: start; gap: .2rem; padding: .5rem .6rem; background: var(--surface-alt); border-radius: 5px; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.rounds li strong { color: var(--ink); }
.rounds li.playing, .rounds li.played { background: var(--accent-soft); }
.rounds li.playing strong, .rounds li.played strong { color: var(--accent); }
.path { position: relative; isolation: isolate; margin-bottom: 1.25rem; padding: 0 clamp(.7rem, 3vw, 1.6rem) 1.05rem; }
.path > .panel-heading { padding-inline: 0; border-bottom: 1px solid var(--line); margin-bottom: .85rem; }
.path h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); }
.path-nav {
  display: flex; gap: .45rem; align-items: center; overflow-x: auto;
  padding: .2rem .14rem .65rem; scrollbar-width: thin;
}
.path-nav button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.path-nav button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.pool-nav-live { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.path-stage { position: relative; margin-inline: auto; }
.bracket-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.bracket-groups { display: grid; grid-template-columns: repeat(var(--pools), minmax(0, 1fr)); min-width: max(100%, calc(var(--pools) * 13.5rem)); }
.bracket-branch { position: relative; display: grid; min-width: 0; padding: 0 .3rem 1.2rem; }
.bracket-branch::after { position: absolute; content: ''; bottom: 0; height: 1.2rem; left: 50%; border-left: 1px solid var(--muted); }
.bracket-branch::before { position: absolute; content: ''; bottom: 0; left: 0; right: 0; border-bottom: 1px solid var(--muted); }
.bracket-branch:first-child::before { left: 50%; }
.bracket-branch:last-child::before { right: 50%; }
.bracket-branch .path-stage { width: 100%; }
.bracket-branch .path-slots { grid-template-columns: minmax(0,1fr); }
.bracket-branch .path-pool-heading { align-items: start; justify-content: space-between; }
.bracket-branch .pill { overflow-wrap: anywhere; }
.path-pool.is-live { border-color: var(--accent); }
.path-team.vacant span { font-size: .78rem; }
.bracket-scroll + .path-line, .path-stage + .path-line { background: var(--muted); height: 1.3rem; }
.path-pool { border: 1px solid var(--line); border-radius: 8px; padding: clamp(.55rem, 2vw, .95rem); }
.path-pool-heading { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; margin-bottom: .7rem; }
.path-pool-heading h3 { font-size: 1.05rem; }
.path-detail { color: var(--muted); font-size: .78rem; }
.path-pool-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; font-size: .81rem; }
.path-pool-actions a { color: var(--accent); font-weight: 800; }
.path-pool-actions button { min-height: 2rem; padding: .25rem .5rem; font-size: .78rem; }
.path-slots, .path-players { list-style: none; margin: 0; padding: 0; }
.path-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.7rem), 1fr)); gap: .5rem; }
.path-team {
  position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-alt); padding: clamp(.48rem, 1.5vw, .8rem); min-height: 5.35rem;
  overflow-wrap: anywhere;
}
.path-team-heading { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .2rem .5rem; justify-content: space-between; }
.path-team-heading strong { font-size: 1rem; }
.path-team-heading span { flex: none; color: var(--accent); font-size: .78rem; font-weight: 800; }
.path-team.vacant { border-style: dashed; display: grid; align-content: center; text-align: center; color: var(--muted); font-size: .85rem; }
.path-players { display: grid; gap: .18rem; margin-top: .4rem; color: var(--muted); font-size: .83rem; line-height: 1.35; }
.path-players li { border-top: 1px solid var(--line); padding-top: .18rem; }
.missing-player { color: #8c4900; font-weight: 700; }
.path-players .missing-player::before { content: ''; display: inline-block; width: .42em; height: .42em; margin: 0 .44em .12em 0; border: 1px dashed currentColor; border-radius: 50%; }
@media (prefers-color-scheme: dark) {
  .missing-player { color: #ffc36b; }
}
.path-line { position: relative; margin: 0 auto; width: 1px; height: 1rem; background: var(--line); }
.path-node { display: grid; gap: .35rem; padding: .65rem; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }
@media (min-width: 760px) {
  .path-slots { grid-template-columns: repeat(auto-fit,minmax(min(10rem,100%),1fr)); gap: .65rem; }
}
.path-current-effect { color: var(--accent); font-size: .81rem; font-weight: 800; }
.path-current-effect:empty { display: none; }
.path-overlay { position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%; pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.path-champion { width: min(100%, 19rem); margin-inline: auto; text-align: center; }
.path-champion span { color: var(--muted); font-size: .82rem; }
.path-champion.has-champion { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.path-champion.has-champion span { color: inherit; }
.pill.preparing { color: var(--gold); background: var(--gold-soft); }
.pool h3 { scroll-margin-block-start: 1rem; }
.phase-preparing { animation: stage-preparing .95s ease-out both; }
.phase-live { animation: stage-live .8s ease-out both; }
@keyframes stage-live { 20% { box-shadow: inset 0 0 0 2px var(--accent); } to { box-shadow: inset 0 0 0 0 transparent; } }
@keyframes stage-preparing { 22% { box-shadow: inset 0 0 0 2px var(--gold); } to { box-shadow: inset 0 0 0 0 transparent; } }
table { border-collapse: collapse; width: 100%; table-layout: fixed; text-align: left; font-size: .9rem; }
thead { color: var(--muted); background: var(--surface-alt); }
th, td { padding: .65rem .5rem; vertical-align: top; overflow-wrap: anywhere; }
tr > :first-child { width: 3.25rem; padding-left: .85rem; }
tr > :nth-child(3), tr > :nth-child(4) { width: 4.45rem; text-align: center; }
thead th { font-size: .74rem; }
tbody tr { border-top: 1px solid var(--line); }
tbody th { font-weight: 700; }
.players, .loss-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-top: .22rem; }
.loss-label { color: var(--red); }
.winner { background: var(--accent-soft); }
.empty { padding: .8rem .95rem; color: var(--muted); line-height: 1.5; }

button, input, select { font: inherit; color: var(--ink); }
button { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .58rem .8rem; min-height: 2.65rem; cursor: pointer; font-size: .9rem; font-weight: 800; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }
button.primary, button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.danger { color: var(--red); }
input, select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 5px; min-height: 2.65rem; padding: .48rem .6rem; background: var(--bg); }
input[type="checkbox"], input[type="radio"] { flex: none; width: 1rem; min-height: 0; height: 1rem; accent-color: var(--accent); }
label { display: grid; gap: .3rem; color: var(--muted); font-weight: 750; font-size: .9rem; }
fieldset { border: 1px solid var(--line); padding: .7rem; margin: 0; min-width: 0; border-radius: 5px; }
legend { font-weight: 800; }
.login { container-type: inline-size; width: min(100%, 29.375rem); margin: clamp(1.25rem, 6vw, 4rem) auto 0; padding: clamp(1rem, 4vw, 2rem); }
.login h1 { font-size: clamp(1.55rem, 14cqi, 3.5rem); line-height: 1.03; margin-top: .4rem; }
.admin-heading h1 { font-size: clamp(2rem, 6vw, 4rem); margin-top: .3rem; }
.login .response:empty { display: none; }
.admin-settings label { min-width: 0; }
.login form { display: grid; gap: .75rem; margin-top: 1.3rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.admin-settings { padding: .9rem; display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin-bottom: .8rem; }
.admin-settings label { flex: 1 1 11rem; }
.response { color: var(--muted); min-height: 1.35rem; margin-block: .45rem; font-size: .88rem; }
.config-toolbar { margin-bottom: .8rem; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .75rem; }
.form-panel, .result-form { display: grid; gap: .7rem; padding: .9rem; }
.form-panel { align-content: start; }
.edit-slot { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: .4rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.edit-slot label { flex: 1 1 7rem; }
.edit-slot > span { align-self: center; color: var(--muted); font-size: .85rem; }
.edit-slot button { font-size: .79rem; }
.control-body > .toolbar:not(:empty) { padding: 0 .95rem .85rem; }
.result-form { padding-top: 0; }
.result-form p { margin-bottom: .5rem; color: var(--muted); font-size: .88rem; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; align-items: center; gap: .5rem; padding: .35rem 0; }
.result-row label, .checks label { display: flex; align-items: center; overflow-wrap: anywhere; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: .65rem; }

[class*="path-impact-"] { --impact: var(--accent); animation: bracket-impact .85s .85s ease-out; }
.path-impact-two { --impact: var(--green); }
body.valorant .path-impact-two { --impact: var(--red); }
.path-impact-three { --impact: var(--red); }
.path-impact-four, .path-impact-champion { --impact: var(--gold); }
.path-impact-five { --impact: var(--red); }
.path-impact-six { --impact: var(--accent); }
.path-stage.path-step-complete + .path-line::after {
  content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: top;
  animation: progress-line .55s 1.05s both;
}
@keyframes progress-line { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
[class*="highlight-"] { animation: team-score .85s .95s ease-out; }
tr.lost { animation: stumble .48s 1.2s ease-out; }
body.valorant tr.lost { animation-name: glitch; }
@keyframes bracket-impact { 30% { box-shadow: inset 0 0 0 3px var(--impact); } }
@keyframes team-score { 30% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } }
@keyframes stumble { 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(1px); } }
@keyframes glitch { 25% { opacity: .6; transform: translateX(2px); } 55% { transform: translateX(-2px); } }

@media (min-width: 740px) {
  .wrap { width: min(100% - 4rem, 1220px); }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
  .game-card { min-height: clamp(335px, 33vw, 445px); }
  .game-card-info { padding: 1.5rem 1.65rem; }
  .header-inner { min-height: 70px; }
  .footer { margin-top: 3.3rem; }
  th, td { padding: .7rem 1rem; }
  tr > :first-child { width: 5rem; }
  tr > :nth-child(3), tr > :nth-child(4) { width: 7rem; }
}
@media (max-width: 365px) {
  .wrap { width: calc(100% - 1.3rem); }
  .header-inner, nav { gap: .45rem; }
  nav { font-size: .76rem; }
  .admin-link { padding-inline: .45rem; }
  .lock { display: none; }
  .brand { font-size: 1.32rem; }
  .home-intro h1 { font-size: 3.85rem; }
  tr > :nth-child(3), tr > :nth-child(4) { width: 3.7rem; }
  tr > :first-child { width: 2.7rem; padding-inline: .45rem; }
  tr > :nth-child(3), tr > :nth-child(4) { padding-inline: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

