*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; height: 100dvh; overflow: hidden; }

:root {
  --bg:        #0d1233;
  --bg2:       #101640;
  --bg3:       #141949;
  --card:      #182057;
  --card2:     #1c2460;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.13);
  --text:      #eeeef0;
  --muted:     #4a5580;
  --muted2:    #7a89b8;
  --orange:    #0084C8;
  --orange2:   #0069B2;
  --orange-bg: rgba(0,132,200,.08);
  --orange-bd: rgba(0,132,200,.28);
  --blue:      #0084C8;
  --blue-bg:   rgba(0,105,178,.08);
  --blue-bd:   rgba(0,105,178,.28);
  --accent:    #38b6ff;
  --accent-bg: rgba(56,182,255,.08);
  --accent-bd: rgba(56,182,255,.25);
  --green:     #00e676;
  --red:       #ff3d3d;
  --r:         5px;
  --r2:        9px;
  --hh:        52px;
  /* Полная высота хедера с учётом safe-area-inset-top (iPhone notch) */
  --header-h:  calc(var(--hh) + env(safe-area-inset-top, 0px));
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }

body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.slides {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--header-h);
  scrollbar-width: none;
  padding-top: var(--header-h);
  -webkit-overflow-scrolling: touch;
}
.slides::-webkit-scrollbar { display: none; }

.slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity .45s ease;
  border-bottom: 1px solid var(--border2);
}
.slide.visible {
  opacity: 1;
}

.slide-content { background: var(--bg); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.slide-content::-webkit-scrollbar { width: 4px; }
.slide-content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.slide-inner {
  flex: 1;
  max-width: 1300px; margin: 0 auto; width: 100%;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  background: rgba(13,18,51,.95); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
}
.brand { display: flex; align-items: center; gap: 6px; font-family: 'Montserrat', sans-serif; font-weight: 900; flex-shrink: 0; }
.brand-itms { font-size: 20px; color: var(--orange); }
.brand-sep  { width: 1px; height: 13px; background: var(--border2); }
.brand-cup  { font-size: 15px; color: var(--text); letter-spacing: .06em; }
.brand-tag  { font-size: 10px; color: var(--muted2); letter-spacing: .1em; border: 1px solid var(--border2); padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.nav { display: flex; gap: 2px; margin-right: auto; }
.nav a { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted2); padding: 5px 10px; border-radius: var(--r); transition: color .12s, background .12s; cursor: pointer; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a.active { color: var(--orange); }
.header-right { position: relative; display: flex; align-items: center; }
.btn-login { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted2); background: transparent; border: 1px solid var(--border2); border-radius: var(--r); padding: 6px 14px; cursor: pointer; transition: all .12s; }
.btn-login:hover { border-color: var(--orange-bd); color: var(--orange); }
.user-chip { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 5px 10px; border: 1px solid var(--border2); border-radius: var(--r); font-size: 13px; font-weight: 600; transition: border-color .12s; }
.user-chip:hover { border-color: var(--orange-bd); }
.user-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--orange-bg); border: 1px solid var(--orange-bd); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--orange); font-family: 'Montserrat', sans-serif; }
.user-dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; background: var(--card2); border: 1px solid var(--border2); border-radius: var(--r2); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.7); }
.ud-info { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ud-name { font-weight: 700; font-size: 14px; }
.ud-nick { color: var(--muted2); font-size: 12px; margin-top: 1px; }
.ud-perms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.perm-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-bd); font-family: 'Montserrat', sans-serif; }
.ud-profile { display: block; width: 100%; padding: 10px 14px; background: transparent; border: none; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; text-align: left; transition: background .12s; }
.ud-profile:hover { background: var(--card-hover, rgba(255,255,255,.04)); }
.ud-logout { display: block; width: 100%; padding: 10px 14px; background: transparent; border: none; cursor: pointer; color: var(--red); font-size: 13px; font-weight: 600; text-align: left; transition: background .12s; }
.ud-logout:hover { background: rgba(255,61,61,.07); }

.side-nav { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 700; display: flex; flex-direction: column; gap: 10px; }
.side-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); border: none; cursor: pointer; transition: background .2s, transform .2s; padding: 0; }
.side-dot:hover { background: var(--muted2); transform: scale(1.4); }
.side-dot.active { background: var(--orange); transform: scale(1.3); }

.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(0,0,0,.9), transparent 90%);
}
.hero-glow-l {
  position: absolute; top: -10%; left: -10%; width: 50%; height: 70%;
  background: radial-gradient(circle, rgba(0,132,200,.08), transparent 65%);
  filter: blur(10px);
}
.hero-glow-r {
  position: absolute; bottom: -15%; right: -10%; width: 55%; height: 75%;
  background: radial-gradient(circle, rgba(255,255,255,.04), transparent 65%);
  filter: blur(10px);
}

.hero-body {
  position: relative; z-index: 1; flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; padding: 36px 32px;
  max-width: 1300px; margin: 0 auto; width: 100%;
  flex-wrap: wrap;
}
.hero-left { flex: 1; min-width: 280px; }

.hero-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted2); margin-bottom: 18px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(0,230,118,.5);}70%{box-shadow:0 0 0 8px rgba(0,230,118,0);}100%{box-shadow:0 0 0 0 rgba(0,230,118,0);} }

.hero-title {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  line-height: .88; margin-bottom: 20px;
  display: flex; flex-direction: column;
  gap: 0;
}
.hero-title em   { font-size: clamp(56px, 9vw, 110px); color: var(--orange); font-style: normal; filter: drop-shadow(0 0 50px rgba(0,132,200,.4)); letter-spacing: -.01em; display: block; }
.hero-title span { font-size: clamp(44px, 7vw, 88px);  color: var(--text); letter-spacing: -.01em; display: block; }

.hero-dates { font-size: 15px; color: var(--muted2); font-weight: 500; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 280px; flex-shrink: 0; }
.hstat { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--r2); padding: 18px 20px; transition: border-color .15s; position: relative; }
.hstat::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  border-top: 1px solid var(--border2); border-right: 1px solid var(--border2);
}
.hstat:hover { border-color: var(--border2); }
.hstat:nth-child(1){border-top:2px solid var(--orange);}
.hstat:nth-child(2){border-top:2px solid var(--blue);}
.hstat:nth-child(3){border-top:2px solid var(--muted);}
.hstat:nth-child(4){border-top:2px solid var(--accent);}
.hstat-val { font-family: 'Montserrat', sans-serif; font-size: 30px; font-weight: 900; line-height: 1; display: block; }
.hstat-lbl { font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .07em; margin-top: 3px; }

.hero-scroll-hint { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding-bottom: 24px; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; animation: bounce 2s ease-in-out infinite; transition: color .12s; }
.hero-scroll-hint:hover { color: var(--muted2); }
@keyframes bounce { 0%,100%{transform:translateY(0);}50%{transform:translateY(5px);} }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.sec-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin-bottom: 4px; }
.sec-title { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: clamp(26px, 3.5vw, 40px); }

.btn-primary { display: inline-flex; align-items: center; gap: 7px; background: var(--orange); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; padding: 9px 20px; border: none; border-radius: var(--r); cursor: pointer; transition: background .12s, transform .08s; }
.btn-primary:hover { background: var(--orange2); }
.btn-primary:active { transform: scale(.97); }
.btn-primary.full { width: 100%; justify-content: center; }
.btn-outline { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--text); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; padding: 8px 20px; border: 1px solid var(--border2); border-radius: var(--r); cursor: pointer; transition: all .12s; }
.btn-outline:hover { border-color: var(--orange-bd); color: var(--orange); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted2); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 9px 18px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; transition: all .12s; width: 100%; }
.btn-ghost:hover { border-color: var(--border2); color: var(--text); }
.btn-danger { background: rgba(255,61,61,.09); color: var(--red); border: 1px solid rgba(255,61,61,.22); font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 9px 16px; border-radius: var(--r); cursor: pointer; transition: background .12s; }
.btn-danger:hover { background: rgba(255,61,61,.16); }
.btn-edit-hero { background: rgba(255,255,255,.05); color: var(--muted2); border: 1px solid var(--border2); border-radius: var(--r); font-size: 13px; font-weight: 600; padding: 8px 16px; cursor: pointer; transition: all .12s; }
.btn-edit-hero:hover { color: var(--text); border-color: var(--border); }
.btn-edit-sec { background: transparent; color: var(--muted2); border: 1px solid var(--border2); border-radius: var(--r); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 7px 14px; cursor: pointer; transition: all .12s; white-space: nowrap; }
.btn-edit-sec:hover { color: var(--orange); border-color: var(--orange-bd); }
.mt16 { margin-top: 14px; }

.bracket-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.btabs { display: flex; gap: 2px; background: var(--bg3); padding: 3px; border-radius: var(--r2); border: 1px solid var(--border); }
.btab { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; padding: 6px 14px; border: none; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; transition: all .12s; }
.btab.active { background: var(--orange); color: #fff; }
.btab:not(.active):hover { color: var(--text); }
.bsearch { display: flex; align-items: center; gap: 7px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 11px; margin-left: auto; }
.bsearch input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 160px; }
.bsearch input::placeholder { color: var(--muted); }
.bsearch button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0; transition: color .12s; }
.bsearch button:hover { color: var(--text); }
.edit-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--orange); background: var(--orange-bg); border: 1px solid var(--orange-bd); border-radius: var(--r); padding: 4px 11px; margin-bottom: 12px; }
.bracket-panel.hidden { display: none; }
.brow { margin-bottom: 20px; }
.brow-label { display: inline-block; font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r); margin-bottom: 8px; }
.upper-l  { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue-bd); }
.lower-l  { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-bd); }
.finals-l { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-bd); }
.bracket-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; position: relative; }
.bracket-scroll::-webkit-scrollbar { height: 3px; }
.bracket-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.bracket-column { flex-shrink: 0; min-width: 180px; }
.bracket-column header { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.bracket-column header strong { display: block; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.bracket-column header span { font-size: 11px; color: var(--muted); }
.bracket-column.blue   header strong { color: var(--blue); }
.bracket-column.orange header strong { color: var(--orange); }
.bracket-column.gold   header strong { color: var(--accent); }
.column-matches { display: flex; flex-direction: column; gap: 7px; }
.match-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; transition: border-color .12s, background .12s; position: relative; z-index: 1; }
.bracket-connector-svg { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; overflow: visible; }
.match-card.editable { cursor: pointer; }
.match-card.editable:hover { border-color: var(--orange-bd); background: var(--card2); }
.match-card.live     { border-color: rgba(0,230,118,.28); }
.match-card.finished { opacity: .85; }
.match-card.filtered-out { display: none; }
.mc-head { display: flex; align-items: center; gap: 5px; padding: 4px 8px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.match-id { display: none; }
.match-format { font-size: 9px; font-weight: 700; color: var(--muted); background: var(--bg2); padding: 1px 5px; border-radius: 3px; }
.mc-time { font-size: 9px; color: var(--muted); margin-left: auto; }
.mc-live { font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green); background: rgba(0,230,118,.1); border: 1px solid rgba(0,230,118,.25); border-radius: 3px; padding: 1px 4px; animation: livepulse 1.5s ease-in-out infinite; }
@keyframes livepulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.team-line { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; font-size: 12px; border-bottom: 1px solid var(--border); }
.team-line:last-of-type { border-bottom: none; }
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 128px; font-weight: 500; }
.team-line b { font-size: 12px; font-weight: 800; font-family: 'Montserrat', sans-serif; margin-left: 6px; flex-shrink: 0; }
.team-line.winner-team { background: rgba(255,255,255,.03); }
.team-line.winner-team .team-name { color: var(--text); font-weight: 700; }
.team-line.loser-team  .team-name { color: var(--muted); }

.schedule-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 20px; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.schedule-strip::-webkit-scrollbar { height: 3px; }
.schedule-strip::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.sched-card { flex-shrink: 0; min-width: 145px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); padding: 12px 14px; transition: border-color .12s; position: relative; cursor: default; }
.sched-card:hover { border-color: var(--border2); }
.sched-card.upper   { border-top: 2px solid var(--blue); }
.sched-card.lower   { border-top: 2px solid var(--orange); }
.sched-card.final   { border-top: 2px solid var(--accent); }
.sched-card.mixed   { border-top: 2px solid var(--muted); }
.sched-card.reserve { border-top: 2px solid var(--border2); opacity: .5; }
.sched-card .sdate  { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.sched-card h3 { font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.sched-meta { display: flex; gap: 7px; font-size: 11px; color: var(--muted2); }
.table-wrap { overflow-x: auto; border-radius: var(--r2); border: 1px solid var(--border); }
.match-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.match-table th { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 13px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.match-table td { padding: 9px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.match-table tr:last-child td { border-bottom: none; }
.match-table tr:hover td { background: var(--bg3); }
.standings-table th { text-align: center; cursor: default; }
.standings-table th:nth-child(2) { text-align: left; }
.standings-table td { text-align: center; }
.standings-table td:nth-child(2) { text-align: left; }
.format-pill { font-size: 10px; font-weight: 700; font-family: 'Montserrat', sans-serif; padding: 2px 6px; border-radius: 3px; background: var(--bg3); color: var(--muted2); border: 1px solid var(--border); }
.muted { color: var(--muted); }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.status-dot.upcoming { background: var(--muted); }
.status-dot.live     { background: var(--green); box-shadow: 0 0 5px var(--green); }
.status-dot.finished { background: var(--blue); }

.teams-section-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted2); margin-bottom: 8px; margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.teams-section-label:first-child { margin-top: 8px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin-bottom: 4px; }
.team-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 9px 12px; display: flex; align-items: center; gap: 8px; transition: border-color .12s; min-width: 0; }
.team-card.can-edit { cursor: pointer; }
.team-card.can-edit:hover { border-color: var(--orange-bd); }
.team-card:not(.can-edit):hover { border-color: var(--border2); }
.team-seed   { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; width: 18px; text-align: center; }
.team-name-el{ font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-role   { font-size: 10px; color: var(--muted2); flex-shrink: 0; background: var(--bg3); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; white-space: nowrap; font-weight: 600; }
.team-role.captain { color: var(--accent); border-color: var(--accent-bd); background: var(--accent-bg); }
.team-rating { font-size: 10px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.team-tag-el { font-size: 10px; color: var(--muted); font-family: 'Montserrat', sans-serif; font-weight: 700; flex-shrink: 0; }

.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rule-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); padding: 20px; transition: border-color .12s; position: relative; overflow: hidden; }
.rule-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--orange), transparent);
  opacity: .5;
}
.rule-card:hover { border-color: var(--border2); }
.rule-num { font-family: 'Montserrat', sans-serif; font-size: 38px; font-weight: 900; line-height: 1; margin-bottom: 10px; }
.rule-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.rule-card p  { font-size: 13px; color: var(--muted2); line-height: 1.6; }
.page-footer { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }

.bracket-empty { color: var(--muted); font-size: 14px; padding: 32px 0; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--orange-bg); border: 2px solid var(--orange-bd); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: var(--orange); font-family: 'Montserrat', sans-serif; flex-shrink: 0; background-size: cover; background-position: center; }
.profile-name { font-size: 17px; font-weight: 700; color: var(--text); }
.profile-username { font-size: 13px; color: var(--muted2); margin-top: 2px; }
.field-editable { display: flex; align-items: center; width: 100%; }
.field-editable span { font-size: 14px; color: var(--text); min-width: 60px; }
.role-toggle { display: flex; gap: 8px; width: 100%; }
.opt-btn-sm {
  flex: 1; padding: 8px 12px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: var(--r); cursor: pointer;
  color: var(--muted2); font-size: 13px; font-weight: 600; text-align: center;
  transition: all .12s; font-family: inherit;
}
.opt-btn-sm:hover { border-color: var(--orange-bd); color: var(--orange); }
.opt-btn-sm.selected { border-color: var(--orange); background: var(--orange-bg); color: var(--orange); }
.sched-row-edit:hover { background: rgba(255,255,255,.03); cursor: default; }

.ctx-menu {
  position: fixed; z-index: 8000;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: var(--r2); padding: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,.7);
  min-width: 170px;
}
.ctx-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .1s, color .1s;
  border: none; background: none; color: var(--text); width: 100%; text-align: left;
}
.ctx-item:hover { background: rgba(255,255,255,.06); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: rgba(255,61,61,.1); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

.modal-backdrop { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.hidden { display: none !important; }
.modal-box { background: var(--card2); border: 1px solid var(--border2); border-radius: 12px; padding: 28px; width: 100%; max-width: 380px; position: relative; box-shadow: 0 28px 72px rgba(0,0,0,.72); }
.modal-box.small { max-width: 340px; }
.modal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 4px 8px; border-radius: var(--r); transition: color .12s; }
.modal-close:hover { color: var(--text); }
.modal-icon { margin-bottom: 14px; }
.modal-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 22px; margin-bottom: 6px; }
.modal-sub   { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.modal-desc  { font-size: 13px; color: var(--muted2); margin-bottom: 22px; line-height: 1.6; }
.modal-actions { display: flex; gap: 9px; }
.modal-actions .btn-primary { flex: 1; justify-content: center; }
.auth-waiting { text-align: center; padding: 14px 0; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border2); border-top-color: var(--orange); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to{transform:rotate(360deg);} }
.auth-waiting p { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.auth-waiting small { font-size: 12px; color: var(--muted2); }
.auth-waiting small a { color: var(--orange); text-decoration: underline; }
.field-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.field-row  { display: flex; flex-direction: column; gap: 4px; }
.field-row label { font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.field-input { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r); color: var(--text); font-size: 14px; padding: 8px 11px; outline: none; transition: border-color .12s; font-family: inherit; }
.field-input:focus { border-color: var(--orange); }
.edit-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.edit-team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.edit-tname { font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-input { width: 52px; text-align: center; background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r); color: var(--text); font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 900; padding: 7px 4px; }
.score-input:focus { outline: none; border-color: var(--orange); }
.edit-vs { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .1em; }
.edit-winner-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted2); flex-wrap: wrap; }
.winner-btn { padding: 6px 12px; background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r); cursor: pointer; color: var(--muted2); font-size: 13px; font-weight: 700; transition: all .12s; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-btn.selected { background: var(--orange-bg); border-color: var(--orange-bd); color: var(--orange); }

.hidden { display: none !important; }

@media (max-width: 700px) {
  :root {
    --hh: 48px;
    --header-h: calc(var(--hh) + env(safe-area-inset-top, 0px));
  }

  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    gap: 10px;
  }
  .brand-tag { display: none; }
  .nav { display: none; }
  .header-right { margin-left: auto; }

  .mobile-nav-toggle { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: transparent; border: 1px solid var(--border2); border-radius: var(--r); cursor: pointer; color: var(--muted2); font-size: 16px; flex-shrink: 0; }

  .mobile-nav {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    background: rgba(13,18,51,.98); backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--border2); z-index: 799; padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .mobile-nav.open { display: block; }
  .mobile-nav a { display: block; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted2); padding: 12px 20px; transition: color .12s; }
  .mobile-nav a.active { color: var(--orange); }
  .mobile-nav a:hover { color: var(--text); }

  .side-nav { display: none; }

  .slide-inner {
    padding: 20px 16px 24px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sec-title { font-size: 28px; }

  .bracket-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .btabs { width: 100%; justify-content: space-between; }
  .btab { flex: 1; text-align: center; padding: 7px 6px; font-size: 12px; }
  .bsearch { margin-left: 0; width: 100%; box-sizing: border-box; }
  .bsearch input { flex: 1; width: auto; }

  .hero-body {
    flex-direction: column; gap: 24px;
    padding: 20px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .hero-actions { flex-wrap: wrap; gap: 8px; }
  .hero-stats { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-start; }

  .rules-grid { grid-template-columns: 1fr 1fr; }

  .modal-box {
    padding: 20px 16px;
    margin: 12px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .teams-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .table-wrap { overflow-x: auto; }

  .user-chip span#userNameLabel { display: none; }
  .user-chip svg { display: none; }
  .user-chip { padding: 4px; border-radius: 50%; }

  /* Чёткие границы страниц */
  .slide { border-bottom: 2px solid var(--border2); }
  .slide-content { border-top: 1px solid rgba(255,255,255,.04); }
}

@media (max-width: 400px) {
  .rules-grid { grid-template-columns: 1fr; }
  .btab { font-size: 11px; padding: 7px 4px; }
}

.mobile-nav-toggle { display: none; }
.org-clickable { cursor: pointer; }
.org-clickable:hover { border-color: var(--orange-bd); }
.pt-val { font-size: 14px; color: var(--text); }

.btn-add-match { background: transparent; border: 1px dashed var(--border2); border-radius: var(--r); color: var(--muted2); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; cursor: pointer; transition: all .12s; margin-left: 8px; vertical-align: middle; }
.btn-add-match:hover { color: var(--orange); border-color: var(--orange-bd); }

.slide-stream { overflow: hidden; display: flex; align-items: center; justify-content: center; }
.stream-wrap { width: min(900px, 92%); height: min(520px, 80%); display: flex; flex-direction: column; }
.stream-wrap > div { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stream-wrap iframe { flex: 1; width: 100% !important; height: 100% !important; border: none; border-radius: 8px; background: #000; }
.side-dot.stream-dot { background: rgba(145, 70, 255, 0.5); }

.stream-slide-inner { display: flex; flex-direction: column; }
.stream-embed-wrap { flex: 1; min-height: 0; border-radius: var(--r2); overflow: hidden; background: #000; border: 1px solid var(--border); position: relative; }
.stream-embed-wrap > div:first-child { width: 100%; height: 100%; }
.stream-offline-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(20,25,73,.98) 0%, var(--bg) 100%);
  border-radius: var(--r2);
}
.stream-offline-overlay.hidden { display: none; }
.stream-offline-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px; }
.stream-offline-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(145,70,255,.07); border: 1px solid rgba(145,70,255,.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  animation: stream-pulse 3s ease-in-out infinite;
}
@keyframes stream-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(145,70,255,.15);}50%{box-shadow:0 0 0 16px rgba(145,70,255,0);} }
.stream-offline-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 22px; color: var(--text); }
.stream-offline-sub { font-size: 13px; color: var(--muted2); margin-top: 2px; }

.time-field-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.time-field-wrap .field-input { flex: 1; }
.btn-unknown-time {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted2); cursor: pointer; transition: all .15s;
  white-space: nowrap; flex-shrink: 0;
}
.btn-unknown-time::before { content: '?'; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--border2); font-size: 9px; font-weight: 800; transition: background .15s; }
.btn-unknown-time:hover { border-color: var(--muted2); color: var(--text); }
.btn-unknown-time.active {
  background: rgba(56,182,255,.1); border-color: var(--accent-bd); color: var(--accent);
}
.btn-unknown-time.active::before { background: var(--accent); color: #fff; }
.time-unknown { font-size: 12px; color: var(--muted2); font-style: italic; letter-spacing: .02em; }

/* Archive */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.archive-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.archive-card:hover {
  background: var(--card2);
  border-color: var(--accent-bd);
}
.archive-card-ext { color: var(--muted); margin-left: auto; flex-shrink: 0; transition: color .15s; }
.archive-card:hover .archive-card-ext { color: var(--accent); }
.archive-card-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  border-radius: var(--r);
  color: var(--accent);
}
.archive-card-info { flex: 1; min-width: 0; }
.archive-card-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive-card-date { font-size: 11px; color: var(--muted2); margin-top: 2px; }

/* ═══════════════════════════════════════
   PLAYOFF SECTION
═══════════════════════════════════════ */

#playoffSection {
  margin-top: 32px;
  border-top: 1px solid var(--border2);
  padding-top: 28px;
}

.po-wrap { display: flex; flex-direction: column; gap: 24px; }

/* Header */
.po-hdr { display: flex; flex-direction: column; gap: 10px; }
.po-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.po-pill {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; border: 1px solid;
}
.po-pill-blue   { color: var(--accent);  border-color: var(--accent-bd);          background: var(--accent-bg); }
.po-pill-dim    { color: var(--muted2);  border-color: var(--border2);             background: var(--bg3); }
.po-pill-green  { color: var(--green);   border-color: rgba(0,230,118,.3);          background: rgba(0,230,118,.06); }
.po-pill-orange { color: var(--orange);  border-color: var(--orange-bd);           background: var(--orange-bg); }

.po-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.1;
  color: var(--text);
}
.po-title em { font-style: normal; color: var(--accent); }
.po-sub { font-size: 13px; color: var(--muted2); line-height: 1.6; max-width: 600px; }


.po-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.po-podium {
  position: sticky;
  top: 12px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r2);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,215,0,.16), transparent 34%),
    radial-gradient(circle at 100% 30%, rgba(56,182,255,.18), transparent 38%),
    linear-gradient(145deg, rgba(28,36,96,.98), rgba(13,18,51,.96));
  box-shadow: 0 18px 45px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
}
.po-podium::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.11), transparent 32%, rgba(255,255,255,.04));
}
.po-podium-kicker {
  position: relative;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.po-podium-title {
  position: relative;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: 14px;
}
.po-podium-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.po-podium-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  background: rgba(255,255,255,.045);
  transition: transform .15s, border-color .15s, background .15s;
}
.po-podium-card:hover {
  transform: translateX(-3px);
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.07);
}
.po-podium-place {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: rgba(13,18,51,.62);
}
.po-podium-place span { font-size: 18px; line-height: 1; }
.po-podium-place strong { font-size: 11px; line-height: 1; }
.po-podium-info { min-width: 0; }
.po-podium-info span {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted2);
}
.po-podium-info b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}
.po-podium-gold { border-color: rgba(255,215,0,.34); box-shadow: inset 2px 0 0 rgba(255,215,0,.82); }
.po-podium-gold .po-podium-place { color: #ffd700; border-color: rgba(255,215,0,.35); }
.po-podium-silver { border-color: rgba(210,225,242,.24); box-shadow: inset 2px 0 0 rgba(210,225,242,.68); }
.po-podium-silver .po-podium-place { color: #d9e5f2; border-color: rgba(210,225,242,.3); }
.po-podium-bronze { border-color: rgba(205,127,50,.32); box-shadow: inset 2px 0 0 rgba(205,127,50,.78); }
.po-podium-bronze .po-podium-place { color: #cd7f32; border-color: rgba(205,127,50,.34); }

/* Bracket scroll container */
.po-scroll {
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.po-scroll::-webkit-scrollbar { height: 3px; }
.po-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* Bracket flex layout */
.po-bracket {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: max-content;
  position: relative;
  padding: 4px 0 12px;
}

/* Column */
.po-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 210px;
  max-width: 240px;
  flex-shrink: 0;
  padding: 0 20px;
}
.po-col:first-child { padding-left: 0; }
.po-col:last-child  { padding-right: 0; }
.po-col-finals { min-width: 250px; }
.po-col-champ  { min-width: 180px; }

.po-col-lbl {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 4px;
}
.po-col-lbl strong {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent);
}
.po-col-lbl span { font-size: 10px; color: var(--muted); }

/* QF body: 2 pairs */
.po-qf-body {
  display: flex; flex-direction: column;
  gap: 16px; flex: 1;
}
.po-pair { display: flex; flex-direction: column; gap: 7px; }

/* SF body: 2 slots that stretch to match QF pair heights */
.po-sf-body {
  display: flex; flex-direction: column;
  gap: 16px; flex: 1;
}
.po-sf-slot {
  flex: 1;
  display: flex; align-items: center;
  min-height: 0;
}
.po-sf-slot .po-match { width: 100%; }

/* Finals column */
.po-finals-body {
  display: flex; flex-direction: column;
  gap: 12px; flex: 1;
}
.po-finals-final { flex: 1; display: flex; align-items: center; }
.po-finals-final .po-match { width: 100%; }
.po-finals-third { display: flex; flex-direction: column; gap: 6px; }
.po-third-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted2);
  padding: 2px 0;
}

/* Champion column */
.po-champ-body { flex: 1; display: flex; align-items: flex-start; padding-top: 4px; }
.po-champ-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 20px 16px;
  background: linear-gradient(135deg, rgba(255,183,0,.07), rgba(56,182,255,.04));
  border: 1px solid rgba(255,183,0,.22);
  border-radius: var(--r2);
  width: 100%;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.po-champ-card:hover {
  border-color: rgba(255,183,0,.4);
  box-shadow: 0 0 24px rgba(255,183,0,.12);
}
.po-champ-icon { font-size: 32px; line-height: 1; }
.po-champ-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px; font-weight: 900;
  color: #ffd700;
  filter: drop-shadow(0 0 8px rgba(255,215,0,.4));
  letter-spacing: .04em;
}
.po-champ-sub { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .08em; }

/* Match cards */
.po-match {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid rgba(56,182,255,.35);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative; z-index: 1;
}
.po-match:hover {
  border-color: var(--accent-bd);
  background: var(--card2);
  box-shadow: 0 0 18px rgba(56,182,255,.1), 0 2px 12px rgba(0,0,0,.3);
}
.po-match.po-tbd {
  opacity: .6;
  border-left-color: var(--border2);
}
.po-match.po-tbd:hover { opacity: .8; box-shadow: none; }
.po-match.po-match-grand {
  border-left-color: rgba(255,183,0,.5);
}
.po-match.po-match-grand:hover {
  border-color: rgba(255,183,0,.5);
  box-shadow: 0 0 18px rgba(255,183,0,.12);
}
.po-match.po-match-3rd {
  border-left-color: var(--border2);
}

/* Match card header */
.po-mh {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.po-mid {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px; font-weight: 800; letter-spacing: .08em;
  color: var(--accent); text-transform: uppercase;
}
.po-match-grand .po-mid { color: #ffd700; }
.po-match-3rd .po-mid   { color: var(--muted2); }
.po-fmt {
  font-size: 9px; font-weight: 700;
  color: var(--muted); background: var(--bg2);
  padding: 1px 5px; border-radius: 3px;
}
.po-ms {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; padding: 1px 5px; border-radius: 3px;
  margin-left: auto;
}
.po-s-soon { color: var(--accent);  background: var(--accent-bg); }
.po-s-tbd  { color: var(--muted2); background: var(--bg3); border: 1px solid var(--border); }
.po-s-done { color: var(--green);  background: rgba(0,230,118,.08); }

/* Team rows */
.po-team {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.po-team:last-of-type { border-bottom: none; }
.po-team:hover { background: rgba(255,255,255,.02); }
.po-tbd-team {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.po-tbd-team:last-of-type { border-bottom: none; }
.po-tbd-team .po-tname { color: var(--muted); font-style: italic; font-size: 11px; flex: 1; }
.po-dash { color: var(--muted); font-size: 12px; font-weight: 700; flex-shrink: 0; }

.po-seed {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px; font-weight: 800;
  color: var(--muted2);
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 3px; padding: 1px 4px;
  flex-shrink: 0; min-width: 22px; text-align: center;
}
.po-tname {
  font-size: 12px; font-weight: 600;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-sc {
  font-size: 12px; font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  color: var(--muted2); flex-shrink: 0;
}
.po-team.po-win .po-tname { color: var(--text); font-weight: 700; }
.po-team.po-win .po-sc    { color: var(--accent); }
.po-team.po-lose .po-tname { color: var(--muted); }
.po-team.po-lose .po-sc    { color: var(--muted); }

.po-mdate {
  font-size: 9px; color: var(--muted);
  padding: 3px 8px; text-align: right;
  background: var(--bg); border-top: 1px solid var(--border);
}

/* Connector SVG */
.po-svg-lines {
  position: absolute; top: 0; left: 0;
  pointer-events: none; z-index: 0; overflow: visible;
}

/* Eliminated section */
.po-elim-wrap {
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 2px solid var(--muted);
  border-radius: var(--r2);
}
.po-elim-ttl {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted2); margin-bottom: 10px;
}
.po-elim-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.po-elim-card {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 5px 11px;
  opacity: .65; transition: opacity .15s;
}
.po-elim-card:hover { opacity: 1; }
.po-elim-g {
  font-size: 9px; font-weight: 800;
  color: var(--muted); background: var(--bg3);
  border: 1px solid var(--border2); border-radius: 3px;
  padding: 1px 5px; text-transform: uppercase; letter-spacing: .06em;
}
.po-elim-n { font-size: 13px; font-weight: 700; color: var(--muted2); }
.po-elim-msg { font-size: 12px; color: var(--muted); line-height: 1.6; font-style: italic; }

/* Responsive */
@media (max-width: 700px) {
  .po-layout { grid-template-columns: 1fr; }
  .po-podium { position: relative; top: auto; order: -1; }
  .po-title { font-size: 22px; }
  .po-col   { min-width: 170px; padding: 0 14px; }
  .po-col-finals { min-width: 200px; }
  .po-col-champ  { min-width: 150px; }
}
@media (max-width: 480px) {
  .po-col { min-width: 155px; padding: 0 10px; }
}


/* Static/Vercel build: Telegram/auth/admin controls are removed/disabled */
#loginBtn,
#userWidget,
#editTournamentBtn,
#addScheduleBtn,
#addParticipantBtn,
#editHint,
.btn-add-match,
.modal-backdrop,
.ctx-menu {
  display: none !important;
}

/* Playoff path connectors */
.po-qf-body,
.po-sf-body,
.po-finals-body { position: relative; }
.po-pair,
.po-sf-slot,
.po-finals-final { position: relative; }
.po-pair::after,
.po-sf-slot::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -20px;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-bd), var(--accent));
  box-shadow: 0 0 8px rgba(56,182,255,.28);
}
.po-sf-slot::before,
.po-finals-final::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -20px;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bd));
  box-shadow: 0 0 8px rgba(56,182,255,.28);
}
.po-pair .po-match::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px;
  width: 10px;
  height: 1px;
  background: var(--accent-bd);
}
.po-pair::before {
  content: '';
  position: absolute;
  top: 25%;
  bottom: 25%;
  right: -10px;
  width: 1px;
  background: var(--accent-bd);
  box-shadow: 0 0 8px rgba(56,182,255,.18);
}

.champion-fireworks {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s ease, visibility .7s ease;
  background:
    radial-gradient(circle at 50% 42%, rgba(56,182,255,.22), transparent 34%),
    linear-gradient(180deg, rgba(13,18,51,.82), rgba(13,18,51,.2) 42%, rgba(13,18,51,.68));
}
.champion-fireworks.is-active {
  opacity: 1;
  visibility: visible;
}
.fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.champion-banner {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%) scale(.9);
  min-width: min(760px, calc(100vw - 32px));
  padding: 28px 34px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(24,32,87,.78), rgba(0,132,200,.22));
  box-shadow: 0 0 50px rgba(56,182,255,.42), inset 0 0 40px rgba(255,255,255,.06);
  text-align: center;
  backdrop-filter: blur(14px);
  animation: champion-pop 4.8s ease both;
}
.champion-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.champion-banner strong {
  display: block;
  color: #fff;
  font-size: clamp(32px, 8vw, 78px);
  line-height: .96;
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 0 18px rgba(56,182,255,.95), 0 0 44px rgba(0,132,200,.75);
}
@keyframes champion-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.72) rotate(-1deg); filter: blur(8px); }
  12%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -52%) scale(1.08); filter: blur(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .champion-fireworks { display: none; }
}
