:root {
  color-scheme: light;
  --ink: #17191d;
  --muted: #777d86;
  --line: #e0e2e6;
  --paper: #f4f5f7;
  --red: #d51e28;
  --red-dark: #aa1720;
  --aqua: #00dbff;
  --gray: #f5f5f5;
  --green: #37b96f;
  --amber: #d89920;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); }
button, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.site-header { position: sticky; top: 0; z-index: 50; display: grid; min-height: 76px; grid-template-columns: 250px 1fr auto; align-items: center; gap: 24px; padding: 0 28px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(21,23,27,.97); color: #fff; backdrop-filter: blur(14px); }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--red); color: #fff; font-size: 21px; font-weight: 1000; font-style: italic; transform: skew(-6deg); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: 15px; letter-spacing: .13em; }
.brand small { margin-top: 5px; color: #8e939c; font-size: 7px; font-weight: 900; letter-spacing: .21em; }
.desktop-nav { display: flex; min-width: 0; align-self: stretch; justify-content: center; }
.nav-button { position: relative; display: inline-flex; min-width: 112px; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 0; background: transparent; color: #8f949d; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.nav-button::after { content: ""; position: absolute; right: 16px; bottom: 0; left: 16px; height: 3px; transform: scaleX(0); background: var(--red); transition: .18s ease; }
.nav-button:hover { color: #fff; }
.nav-button.is-active { color: #fff; }
.nav-button.is-active::after { transform: scaleX(1); }
.header-status { display: flex; align-items: center; gap: 10px; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: #a4a8af; font-size: 8px; text-transform: uppercase; }
.connection i, .site-footer i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(216,153,32,.12); }
.connection.online i, .site-footer i { background: var(--green); box-shadow: 0 0 0 4px rgba(55,185,111,.12); }
.connection.offline i { background: var(--red); }
.refresh { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #373a40; background: #202328; color: #fff; font-size: 20px; }
.refresh:hover { border-color: #5a5e66; }

.event-strip { position: relative; display: flex; min-height: 210px; align-items: flex-end; justify-content: space-between; gap: 30px; overflow: hidden; padding: 35px max(28px, calc((100vw - 1420px) / 2)); background: linear-gradient(120deg, #15171b 0%, #202329 62%, #441318 100%); color: #fff; }
.event-strip::before { content: ""; position: absolute; right: 24%; top: -180px; width: 340px; height: 340px; transform: rotate(25deg); border: 54px solid rgba(255,255,255,.025); }
.event-strip::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 7px; background: var(--red); }
.event-strip > * { position: relative; z-index: 1; }
.eyebrow { display: block; color: #ef555d; font-size: 8px; font-weight: 950; letter-spacing: .14em; }
.event-strip h1 { margin: 11px 0 7px; font-size: clamp(30px, 4vw, 50px); letter-spacing: -.055em; }
.event-strip p { margin: 0; color: #aeb2ba; font-size: 10px; }
.local-clock { min-width: 245px; padding: 19px 22px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.055); text-align: right; }
.local-clock span, .local-clock small { display: block; color: #9398a1; font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.local-clock strong { display: block; margin: 7px 0 4px; font-size: 31px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

.content-wrap { position: relative; width: min(1420px, 100%); min-height: 520px; margin: 0 auto; padding: 28px; }
.loading { position: fixed; inset: 76px 0 auto; z-index: 80; height: 3px; overflow: hidden; background: rgba(213,30,40,.16); }
.loading i { display: block; width: 35%; height: 100%; animation: loading 1s infinite ease-in-out; background: var(--red); }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
.notice { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #edcfd1; border-left: 4px solid var(--red); background: #fff2f3; color: #92212a; font-size: 10px; }
.notice.demo { border-color: #efdcae; border-left-color: var(--amber); background: #fff9e9; color: #7c5a16; }
.page-stack { display: flex; flex-direction: column; gap: 18px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.page-heading h2 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.count-chip { padding: 9px 12px; border: 1px solid var(--line); background: #fff; color: #5d626b; font-size: 9px; font-weight: 900; }
.empty { display: grid; min-height: 310px; place-items: center; align-content: center; gap: 10px; padding: 35px; border: 1px dashed #d2d5da; background: #fff; text-align: center; }
.empty strong { font-size: 18px; }
.empty p { max-width: 480px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.mat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; align-items: start; }
.mat-column { overflow: hidden; border: 1px solid #292c32; background: #17191d; box-shadow: 0 14px 32px rgba(20,22,26,.11); }
.mat-column > header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 3px solid var(--red); color: #fff; }
.mat-column > header strong { font-size: 14px; }
.mat-column > header span { color: #8e939b; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.fight-card { position: relative; padding: 14px; border-top: 1px solid rgba(255,255,255,.08); background: #202328; color: #fff; }
.fight-card.is-next { background: linear-gradient(125deg, #272a30, #31171a); }
.fight-card.is-next::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--red); }
.fight-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fight-meta span { color: #ef555d; font-size: 8px; font-weight: 950; }
.fight-meta strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.fight-card small { display: block; overflow: hidden; margin: 7px 0 9px; color: #8e939c; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.athlete-line { display: flex; min-height: 35px; align-items: center; padding: 7px 9px; color: #111418; font-size: 9px; font-weight: 950; text-transform: uppercase; }
.athlete-line.aqua { background: var(--aqua); }
.athlete-line.gray { margin-top: 3px; background: var(--gray); }
.mat-empty { padding: 36px 16px; color: #858a93; font-size: 9px; text-align: center; }

.category-picker { display: flex; width: min(600px, 100%); min-width: 390px; flex-direction: column; gap: 7px; padding: 11px 13px 13px; border-left: 5px solid var(--red); background: #17191d; box-shadow: 0 10px 25px rgba(23,25,29,.16); }
.category-picker span { color: #fff; font-size: 8px; font-weight: 950; letter-spacing: .1em; }
.category-picker select, .result-picker { width: 100%; min-height: 47px; padding: 0 12px; border: 2px solid #fff; outline: 0; background: #fff; color: #17191d; font-size: 10px; font-weight: 900; }
.category-picker select:focus, .result-picker:focus { border-color: var(--aqua); }
.bracket-board { display: flex; gap: 80px; overflow-x: auto; padding: 20px 20px 32px; border: 1px solid #d7dade; background-color: #e8e9eb; background-image: linear-gradient(rgba(255,255,255,.28) 1px, transparent 1px); background-size: 100% 32px; }
.bracket-stage { display: flex; width: 315px; min-width: 315px; flex-direction: column; gap: 28px; }
.bracket-stage > h3 { position: sticky; top: 0; z-index: 2; margin: 0 0 4px; padding: 14px 15px; background: #078ba7; color: #fff; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.bracket-match { position: relative; }
.bracket-stage:not(:last-child) .bracket-match::after { content: ""; position: absolute; z-index: 0; top: 88px; left: 100%; width: 80px; border-top: 2px solid #455b69; }
.bracket-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 43px; padding: 0 2px 8px; color: #333840; font-size: 8px; font-weight: 900; }
.bracket-meta b { color: #087f9d; font-size: 11px; }
.bracket-table { position: relative; z-index: 1; overflow: hidden; border: 1px solid #c9cdd1; background: #fff; box-shadow: 0 5px 14px rgba(24,27,31,.08); }
.bracket-athlete { display: flex; min-height: 53px; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 10px; border-top: 1px solid rgba(0,0,0,.09); color: #15181c; }
.bracket-athlete:first-child { border-top: 0; }
.bracket-athlete.aqua { background: var(--aqua); }
.bracket-athlete.gray { background: var(--gray); }
.bracket-athlete > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.bracket-athlete strong, .bracket-athlete small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-athlete strong { font-size: 9px; font-weight: 950; text-transform: uppercase; }
.bracket-athlete small { color: #42474e; font-size: 7px; }
.bracket-athlete em { display: grid; min-width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #17643e; color: #fff; font-size: 11px; font-style: normal; font-weight: 900; }
.bracket-athlete.is-loser { background: #eceef0; color: #737780; opacity: .4; filter: grayscale(1); }

.ranking { overflow: hidden; border: 1px solid #2c2f35; background: #181a1f; color: #fff; }
.ranking > header { padding: 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.ranking > header span { color: #ef555d; font-size: 8px; font-weight: 950; letter-spacing: .1em; }
.ranking > header h3 { margin: 7px 0 4px; font-size: 24px; }
.ranking > header p { margin: 0; color: #858a93; font-size: 8px; }
.ranking-head, .ranking-row { display: grid; min-height: 51px; grid-template-columns: 44px minmax(170px,1fr) 150px 100px 70px; align-items: center; gap: 8px; padding: 0 18px; border-top: 1px solid rgba(255,255,255,.07); }
.ranking-head { min-height: 38px; color: #747984; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.ranking-row { color: #c9ccd2; font-size: 9px; }
.ranking-row strong { color: #fff; }
.ranking-row b { color: var(--aqua); font-size: 13px; }
.position { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: #30333a; color: #fff; font-size: 9px; }
.position.p1 { background: #c49a26; }
.position.p2 { background: #818895; }
.position.p3 { background: #9b673f; }
.result-panel, .rules-panel { padding: 20px; border: 1px solid var(--line); background: #fff; }
.result-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.result-panel h3 { margin: 0 0 4px; font-size: 16px; }
.result-panel p { margin: 0; color: var(--muted); font-size: 8px; }
.result-picker { width: min(520px, 100%); border-color: #d9dce1; }
.medals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 17px 0; }
.medal { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; padding: 14px; border-left: 4px solid #078ba7; background: #f4f6f7; }
.medal b { grid-row: span 2; align-self: center; color: #078ba7; font-size: 9px; }
.medal strong { font-size: 9px; text-transform: uppercase; }
.medal small { color: #7d828a; font-size: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; border-bottom: 1px solid var(--line); background: #f6f7f8; color: #81868f; font-size: 7px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #eceef1; color: #565b64; font-size: 9px; white-space: nowrap; }
td strong { color: #292d33; text-transform: uppercase; }

.team-rosters { display: flex; flex-direction: column; gap: 18px; }
.team-roster { overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 10px 27px rgba(29,32,38,.05); }
.team-roster > header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 0 19px; border-top: 4px solid var(--red); background: #17191d; color: #fff; }
.team-roster h3 { margin: 0; font-size: 19px; }
.team-roster header strong { padding: 7px 10px; background: var(--red); font-size: 9px; }
.roster-head, .roster-row { display: grid; grid-template-columns: minmax(280px,.95fr) minmax(280px,1.05fr); }
.roster-head { border-bottom: 2px solid var(--red); background: #f3f4f6; font-size: 8px; font-weight: 950; text-transform: uppercase; }
.roster-head span, .roster-row > * { padding: 11px 16px; }
.roster-row { min-height: 48px; border-top: 1px solid #e3e5e8; color: #292d32; font-size: 9px; }
.roster-row:nth-child(even) { background: #fafafb; }
.roster-row strong { text-transform: uppercase; }

.rules-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.rule-card { min-height: 185px; padding: 20px; border: 1px solid var(--line); background: #fff; }
.rule-card > span { color: var(--red); font-size: 10px; font-weight: 950; }
.rule-card h3 { margin: 14px 0 9px; font-size: 15px; }
.rule-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.rule-data { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.rules-panel h3 { margin: 0 0 13px; font-size: 15px; }
.rules-panel p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.time-row { display: flex; min-height: 40px; align-items: center; justify-content: space-between; border-top: 1px solid #eceef0; font-size: 9px; }

.site-footer { display: flex; min-height: 68px; align-items: center; gap: 18px; padding: 0 max(28px, calc((100vw - 1420px) / 2)); border-top: 1px solid #2e3137; background: #17191d; color: #888d96; font-size: 8px; }
.site-footer > span { display: inline-flex; align-items: center; gap: 8px; color: #b8bbc1; font-weight: 900; }
.site-footer p { flex: 1; }
.site-footer strong { color: #a8acb3; font-variant-numeric: tabular-nums; }
.mobile-nav { display: none; }

@media (max-width: 1040px) {
  .site-header { grid-template-columns: auto 1fr auto; }
  .nav-button { min-width: 0; padding: 0 10px; font-size: 8px; }
  .mat-grid, .rules-grid { grid-template-columns: 1fr 1fr; }
  .mat-column:last-child { grid-column: 1/-1; }
  .rule-data { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .site-header { min-height: 66px; grid-template-columns: 1fr auto; padding: 0 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .desktop-nav { display: none; }
  .connection b { display: none; }
  .event-strip { min-height: 235px; align-items: flex-start; flex-direction: column; justify-content: flex-end; padding: 27px 18px; }
  .event-strip h1 { font-size: 32px; }
  .local-clock { width: 100%; min-width: 0; padding: 13px 15px; text-align: left; }
  .local-clock strong { font-size: 25px; }
  .content-wrap { padding: 19px 14px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .category-picker { min-width: 0; }
  .mat-grid, .rules-grid, .medals { grid-template-columns: 1fr; }
  .mat-column:last-child { grid-column: auto; }
  .ranking-head, .ranking-row { grid-template-columns: 35px minmax(150px,1fr) 55px; }
  .ranking-head > *:nth-child(3), .ranking-row > *:nth-child(3), .ranking-head > *:nth-child(4), .ranking-row > *:nth-child(4) { display: none; }
  .result-panel > header { align-items: stretch; flex-direction: column; }
  .roster-head, .roster-row { grid-template-columns: 1fr; }
  .roster-head span:first-child { display: none; }
  .roster-row span { padding-bottom: 3px; color: #676c74; font-size: 8px; }
  .roster-row strong { padding-top: 3px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 7px; padding: 17px 16px; }
  .site-footer p { margin: 0; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 70; display: grid; min-height: calc(64px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5,1fr); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid #34373d; background: rgba(21,23,27,.98); backdrop-filter: blur(14px); }
  .mobile-nav .nav-button { min-height: 64px; flex-direction: column; gap: 4px; padding: 5px 2px; color: #848992; font-size: 7px; }
  .mobile-nav .nav-button::before { content: attr(data-symbol); font-size: 17px; line-height: 1; }
  .mobile-nav .nav-button::after { right: 6px; bottom: auto; left: 6px; top: 0; }
}
