/* Keep overflow clipping from creating a scroll container that defeats sticky. */
html:has([data-platform-header]), body:has([data-platform-header]) { overflow-x: clip; }
/* The same header occupies the same grid on every live platform page. */
body .platform-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  background: #fff;
  color: #193633;
  font-family: Manrope, sans-serif;
  border-bottom: 1px solid #d3e4e1;
}
.platform-header *, .platform-header *::before, .platform-header *::after { box-sizing: border-box; }
.platform-header [hidden] { display: none !important; }
.platform-header .platform-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  min-height: 78px;
  padding: 0 30px;
  margin: 0 auto;
}
.platform-header .platform-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  font-size: 24px;
  letter-spacing: -.04em;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  color: #193633;
  white-space: nowrap;
}
.platform-header .platform-brand { margin-right: auto; }
.platform-brand :is(svg,img) { width: 36px; height: auto; aspect-ratio: 90 / 94; object-fit: contain; flex: 0 0 36px; }
.platform-header .platform-menu { position: relative; flex: 0 0 auto; }
.platform-header .header-menu-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 13px; border: 1px solid #c5dbd5; border-radius: 12px;
  background: #edf6f4; color: #193633; cursor: pointer; font: 700 14px/1.2 Manrope, sans-serif;
  list-style: none; white-space: nowrap;
}
.platform-header .header-menu-button::-webkit-details-marker { display: none; }
.platform-header .header-menu-button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.platform-header .platform-menu[open] > .header-menu-button { background: #c9eae5; }
.platform-header .platform-menu > .platform-nav {
  display: none; position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; left: auto;
  width: max-content; min-width: min(280px, calc(100vw - 24px)); max-width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, calc(100dvh - 88px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; border: 1px solid #c5dbd5; border-radius: 16px; background: #fff;
  box-shadow: 0 12px 38px rgb(25 54 51 / 22%); scrollbar-color: #81b6ad #f1f7f6;
}
.platform-header .platform-menu[open] > .platform-nav { display: grid; gap: 3px; }
.platform-header .platform-nav .nav-group { display: grid; gap: 2px; }
.platform-header .platform-nav .nav-group + .nav-group { margin-top: 5px; padding-top: 7px; border-top: 1px solid #d3e4e1; }
.platform-header .nav-group-title { padding: 6px 10px 3px; color: #425f5b; font: 700 11px/1.4 Manrope, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.platform-header .platform-menu .platform-nav a, .platform-header .platform-menu .header-logout {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  min-height: 44px; padding: 8px 10px; border: 0; border-radius: 9px; color: #193633;
  background: transparent; font: 700 14px/1.3 Manrope, sans-serif; text-align: left; text-decoration: none; cursor: pointer;
}
.platform-header .platform-menu .platform-nav a:hover, .platform-header .platform-menu .header-logout:hover { background-color: #e8f4f1; color: #146d63; }
.platform-header .nav-hint { color: #425f5b; font: 500 11px/1.35 Manrope, sans-serif; }
.platform-header .platform-menu .platform-nav a[aria-current="page"] { color: #146d63; background-color: #e2f3ef; }

/* Animata Animated Gradient Text. The second clip keeps the menu row's background visible. */
@supports (background-clip: text) and (-webkit-text-fill-color: transparent) {
  @media screen and (forced-colors: none) {
    .platform-header .platform-menu .platform-nav a[href="/series"],
    .grouped-event .event-series-name {
      background-image: linear-gradient(90deg, #815800 5ch, #984421 10ch, #a02c63 17ch), none;
      background-clip: text, border-box;
      background-size: 200% 100%, auto;
      background-position: -5ch center, center;
      -webkit-text-fill-color: transparent;
    }
    @media (prefers-reduced-motion: no-preference) {
      body:not(.quiet-motion) .platform-menu[open] .platform-nav a[href="/series"],
      body:not(.quiet-motion) .grouped-event .event-series-name {
        animation: series-menu-gradient 3s ease-in-out infinite alternate;
      }
    }
  }
}
@keyframes series-menu-gradient {
  from { background-position: 0% center, center; }
  to { background-position: -10ch center, center; }
}
.platform-header .platform-menu .nav-error { margin: 0; padding: 6px 10px; color: #8b2e24; font: 600 12px/1.45 Manrope, sans-serif; overflow-wrap: anywhere; }
.platform-header .platform-menu .header-logout { width: 100%; }
.platform-header .header-icon-button {
  display: inline-grid;
  place-items: center;
  position: relative;
  min-height: 44px;
  width: 48px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: #edf6f4;
  color: #193633;
  cursor: pointer;
  font: inherit;
}
.platform-header .notification-button { flex: 0 0 auto; }
.platform-header .header-icon-button:hover { background: #d8eeea; }
.platform-header .header-icon-button[aria-expanded="true"] { background: #c9eae5; }
.platform-header .header-icon-button svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.platform-header .notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  height: 20px;
  min-width: 20px;
  border-radius: 10px;
  padding: 0 4px;
  background: #146d63;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Messages card, adapted from https://uiverse.io/Siyu1017/heavy-fox-66
 * Copyright (c) 2026 Siyu1017 (史萊姆奶茶). MIT License.
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 * associated documentation files (the "Software"), to deal in the Software without restriction,
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions: The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS",
 * WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
 * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
.platform-header .notification-panel {
  position: absolute;
  z-index: 2;
  width: min(360px, 90vw);
  max-height: min(475px, 56dvh, calc(100dvh - 100px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid #d3e2dd;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 36px rgb(25 54 51 / 16%), 0 2px 6px rgb(25 54 51 / 6%);
  scrollbar-width: thin;
  scrollbar-color: #a9c8bf transparent;
}
.platform-header .notification-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.platform-header .notification-heading h2 { margin: 0; font: 700 21px/1.3 Manrope, sans-serif; color: #193633; }
.platform-header .notification-close { min-height: 44px; width: 44px; background: transparent; }
.platform-header .notification-preferences { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: #425f5b; margin-top: 14px; padding-top: 12px; border-top: 1px solid #deebe6; }
.platform-header .notification-preferences input { flex: 0 0 auto; width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 1px 0 0; accent-color: #146d63; }
.platform-header .notification-message { margin: 0; font-size: 14px; line-height: 1.5; color: #425f5b; overflow-wrap: anywhere; }
.platform-header .notification-message:not(:empty) { padding: 12px 0; }
.platform-header .notification-action { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 8px; padding: 8px 0; color: #146d63; background: transparent; border: 0; font: 700 13px/1.4 Manrope, sans-serif; cursor: pointer; text-align: left; text-underline-offset: 3px; }
.platform-header .notification-action:hover { text-decoration: underline; }
.platform-header button:disabled { opacity: .6; cursor: wait; }
.platform-header .notification-list {
  display: grid;
  gap: 9px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.platform-header .notification-item {
  position: relative;
  margin: 0;
  border: 1px solid #dce6e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(25 54 51 / 7%);
}
.platform-header .notification-item.is-unread { border-color: #b5d8ca; background: #f7fcf9; }
.platform-header .notification-content {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 12px;
  border-radius: inherit;
  color: #193633;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.platform-header .notification-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff89b0, #7e5dff);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 45%);
}
.platform-header [data-kind="tournament"] .notification-icon { background: linear-gradient(140deg, #85dbbe, #258988); }
.platform-header :is([data-kind="play"], [data-kind="match"]) .notification-icon { background: linear-gradient(135deg, #46c5ff, #5559ec); }
.platform-header [data-kind="entry"] .notification-icon { background: linear-gradient(125deg, #ffc45f, #ed765e); }
.platform-header .is-unread .notification-icon::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #f7fcf9;
  background: #146d63;
}
.platform-header .notification-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.platform-header .notification-content strong { font: 700 14px/1.35 Manrope, sans-serif; }
.platform-header .notification-content p { margin: 5px 0 0; color: #425f5b; font: 500 13px/1.45 Manrope, sans-serif; }
.platform-header .notification-content time { color: #526863; font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.platform-header .notification-content time::before { content: '· '; }
@media (hover: hover) and (pointer: fine) {
  .platform-header a.notification-content:hover { background: #edf7f2; box-shadow: 0 4px 14px rgb(25 54 51 / 10%); }
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-pointer-ui] .platform-header .notification-panel:not([hidden]) .notification-item:nth-child(-n+5) {
    animation: notification-arrive 185ms var(--notification-delay, 0ms) backwards cubic-bezier(.22, 1, .36, 1);
    transform-origin: top center;
  }
  :root[data-pointer-ui] .notification-item:nth-child(2) { --notification-delay: 25ms; }
  :root[data-pointer-ui] .notification-item:nth-child(3) { --notification-delay: 50ms; }
  :root[data-pointer-ui] .notification-item:nth-child(4) { --notification-delay: 75ms; }
  :root[data-pointer-ui] .notification-item:nth-child(5) { --notification-delay: 100ms; }
}
@keyframes notification-arrive {
  from { opacity: .7; transform: translateY(-3px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.platform-header :focus-visible { outline: 3px solid #146d63; outline-offset: 3px; }
.header-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 960px) {
  .platform-header .platform-header-inner { gap: 8px; min-height: 68px; padding: 0 18px; }
  .platform-header .platform-brand { font-size: 22px; gap: 10px; }
  .platform-header .platform-brand :is(svg,img) { width: 32px; flex-basis: 32px; }
  .platform-header .header-icon-button { width: 44px; }
  .platform-header .notification-panel { padding: 12px; }
}
@media (max-width: 420px) {
  .platform-header .platform-header-inner { padding-inline: 12px; }
  .platform-header .platform-brand { font-size: 20px; gap: 9px; }
  .platform-header .platform-brand :is(svg,img) { width: 28px; flex-basis: 28px; }
  .platform-header .header-menu-button { padding-inline: 10px; }
}
@media (max-width: 350px) {
  .platform-header .platform-brand { font-size: 18px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .platform-header *, .platform-header *::before, .platform-header *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print { .platform-header { display: none !important; } }
