/* Glass materials: static highlights on surfaces; blur only on floating navigation. */
:root {
  --glass-fill: rgba(249, 252, 255, .78);
  --glass-edge: rgba(255, 255, 255, .94);
  --glass-depth: 0 12px 36px -18px #162b5266, inset 0 1px 0 #fff, inset 0 -1px 0 #9aaac826;
}
#bottom, .site-header nav {
  border: 1px solid var(--glass-edge);
  background: linear-gradient(145deg, #fffffff0, #f4f8ffd9 55%, #ffffffed);
  box-shadow: var(--glass-depth);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}
.site-header nav {
  padding: 6px;
  border-radius: 24px;
  gap: 4px;
}
.site-header nav a { border-radius: 18px; }
.site-header nav a[aria-current="page"] {
  background: #ffffffbd;
  color: #1749cb;
  box-shadow: inset 0 1px 0 white, 0 2px 7px #2035520c;
}
#bottom button { color: #455778; }
#bottom button.active:not(.nav-home) {
  background: #ffffffa8;
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px #28436c0b;
  color: #1749cb;
}
#bottom .nav-home-symbol {
  border-radius: 16px;
  border: 1px solid #ffffffb5;
  background: linear-gradient(145deg, #25466f, #102447);
  box-shadow: inset 0 1px 1px #ffffff91, inset 0 -2px 4px #00000025, 0 4px 10px #182f5425;
}
#bottom .nav-home.active .nav-home-symbol {
  background: linear-gradient(145deg, #6ab9ff, #1b63ec 65%, #1950bc);
}
.payment-shortcut {
  border: 1px solid #a9dbff9c;
  background: linear-gradient(125deg, #468efd, #1c59dd);
  box-shadow: inset 0 1px 0 #ffffff7a, inset 0 -2px 5px #123e8b4d, 0 6px 16px #030c2929;
}
.payment-shortcut:hover { background: linear-gradient(125deg, #579bff, #2464eb); }
#modal {
  background: #f8fbff;
  border: 1px solid #fff;
  box-shadow: 0 18px 56px -12px #0a203745, inset 0 1px 0 #fff;
}
#modal::backdrop { background: #152a4659; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
#modal .modal-top { background: #f8fbff; }
@media (max-width: 767px) {
  #bottom {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 76px;
    padding: 8px 6px;
    border-radius: 27px;
    gap: 2px;
  }
  #bottom button { min-height: 56px; border-radius: 20px; }
  #bottom .nav-home-symbol { height: 38px; }
  .shell { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .request-status { bottom: calc(104px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(104px + env(safe-area-inset-bottom)); }
  .site-header nav { width: 100%; justify-content: space-between; border-radius: 22px; }
  .site-header nav a { padding-inline: 10px; }
}
@media (min-width: 768px) {
  #sidebar {
    background: linear-gradient(160deg, #ffffffd9, #edf4ffa8);
    border-right: 1px solid #fff;
    -webkit-backdrop-filter: blur(20px) saturate(1.25);
    backdrop-filter: blur(20px) saturate(1.25);
    box-shadow: 8px 0 32px -25px #15365a66;
  }
  .side-nav button.active { background: #fff; box-shadow: inset 0 1px 0 #fff, 0 3px 12px #1d3b6410; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #bottom, .site-header nav { background: #f6f9ff; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  #bottom, .site-header nav, #sidebar, #modal {
    background: #f7faff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: #b5c3d8;
  }
}
@media (forced-colors: active) {
  #bottom, .site-header nav, #sidebar, #modal { background: Canvas; border: 1px solid ButtonText; box-shadow: none; backdrop-filter: none; }
  #bottom .nav-home-symbol, #bottom .nav-home.active .nav-home-symbol { background: Highlight; border-color: Highlight; }
  #bottom .nav-home-symbol .bolt, #bottom .nav-home.active .bolt { background: HighlightText; }
}

/* Fine optical rim defines the floating navigation without obscuring its labels. */
#bottom::before, .site-header nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 1px #ffffffb3;
}
.site-header nav { position: relative; }
@media (forced-colors: active) {
  #bottom::before, .site-header nav::before { display: none; }
}

/* Shared material uses static paint, never a blur layer per card or button. */
body {
  background: radial-gradient(ellipse at 0 10%, #deebf8 0, transparent 52%),
    radial-gradient(ellipse at 100% 65%, #e8edf5 0, transparent 56%), #f2f5f9;
}
:is(#app, #site, #modal) :is(.card, .event-card, .calendar-card, .collection-card, .player-card, .player-tile, .media-tile, .scoreboard-card, .player, .match-row),
.role-switch {
  background: linear-gradient(150deg, #fffffff2, #f1f6fcde);
  border: 1px solid #dce5f0;
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px -10px #253c5f50;
}
/* Keep colored semantic bases and selected states under the optical highlight. */
body button,
body :is(a.primary, a.secondary, .social-button, [role="button"]),
.site-header nav a {
  background-image: linear-gradient(155deg, #ffffff45 0%, #ffffff16 42%, #ffffff00 43%, #91b5d51a 100%);
  box-shadow: inset 0 1px 1px #ffffffb3, inset 1px 0 1px #ffffff40,
    inset 0 -1px 2px #243f702e, 0 3px 9px -6px #14325966;
}
body :is(button.primary, a.primary, #submit, .payment-shortcut, .social-button) {
  background-color: #1c59dd;
  background-image: linear-gradient(155deg, #a5daff70, #ffffff0d 44%, #1842ae30 45%, #1038a638);
  box-shadow: inset 0 1px 1px #cceaffd9, inset 1px 0 1px #ffffff57,
    inset 0 -2px 3px #12337952, 0 5px 12px -8px #1244a8a6;
}
body button:disabled { opacity: .55; box-shadow: inset 0 1px 0 #ffffff80; }
body :is(button, a.primary, a.secondary, .social-button):focus-visible {
  outline: 3px solid #195bdb;
  outline-offset: 3px;
}
:is(#app .balance-hero, #site .next-game) {
  border: 1px solid #b8d4ed80;
  box-shadow: inset 0 2px 1px #ffffff73, inset 1px 0 1px #ffffff38,
    inset 0 -1px 2px #a9d4ef42, 0 10px 24px -18px #14365c99;
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :is(#app, #site, #modal) :is(.card, .event-card, .calendar-card, .collection-card, .player-card, .player-tile, .media-tile, .scoreboard-card, .player, .match-row), .role-switch {
    background: #f8fbff; border-color: #b5c3d8; box-shadow: none;
  }
  body button, body :is(a.primary, a.secondary, .social-button, [role="button"]) { background-image: none; }
}
@media (forced-colors: active) {
  body { background: Canvas; }
  body button, body :is(a.primary, a.secondary, .social-button, [role="button"]),
  :is(#app, #site, #modal) :is(.card, .event-card, .calendar-card, .collection-card, .player-card, .player-tile, .media-tile, .scoreboard-card, .player, .match-row) {
    background: Canvas; color: CanvasText; border: 1px solid ButtonText; box-shadow: none;
  }
}

/* Compact hierarchy leaves room for the next action on the first screen. */
#header { background: transparent; }
:is(#header, .tournament-preview-header) .header-actions [data-go="profile"] { background: transparent; border: 0; border-radius: 50%; box-shadow: none; }
:is(#header, .tournament-preview-header) .notification-button { background: #f6faffbf; border: 1px solid #cedceb; border-radius: 50%; box-shadow: inset 0 1px 0 #fff; }
#app .intro { margin-bottom: 20px; }
#app .intro h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.08; }
#app .intro p { margin-top: 8px; }
#app .balance-value { padding: 4px 12px; width: fit-content; font-size: clamp(40px, 5vw, 56px); margin: 12px 0 8px; }
#app .balance-detail { padding: 6px 10px; min-height: 36px; }
#app .balance-explain { min-height: 40px; padding: 8px 12px; line-height: 1.4; }
#app .balance-hero .payment-shortcut { height: 54px; min-height: 54px; font-size: 22px; border-radius: 16px; }
#app .shortcut { min-height: 56px; padding: 12px 14px; }
#app .home-shortcuts { gap: 12px; margin-bottom: 12px; }
#app .home-statistics-link { margin-bottom: 24px; }
#app .card, #app .event-card { border-radius: 20px; }
#app .event-card h3 { font-size: 24px; }
#app .player-grid { gap: 16px; }
#modal { border-radius: 24px; }
#site .next-game .teams { gap: 16px; margin: 24px 0; }
#site .next-game .teams h2 { font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.3px; }
#site .next-game .teams > div:not(.vs) { grid-template-rows: 80px minmax(62px, auto) 20px; }
#site .next-game .teams .team-logo { width: 80px; height: 80px; }
#site .next-game .teams .team-logo img { width: 66px; height: 66px; }
#site .next-game .vs { font-size: 42px; letter-spacing: -2px; }
#site .next-game .broadcast-note { padding: 16px; gap: 12px; }
#site .next-game .announcement { font-size: 13px; line-height: 1.6; }
@media (max-width: 767px) {
  #header { height: 72px; }
  .demo-bar { padding: 8px; margin-bottom: 18px; }
  #app .intro { margin-bottom: 18px; }
  #app .intro h1 { font-size: 32px; }
  #app .intro p { font-size: 13px; }
  #app .balance-hero { padding: 20px; border-radius: 24px; margin-bottom: 12px; }
  #app .balance-hero > p { margin-bottom: 16px; font-size: 13px; }
  #app .balance-value { font-size: 46px; }
  #app .shortcut { gap: 8px; font-size: 13px; }
  #app .card, #app .event-card { padding: 18px; }
  #app .profile-menu { padding: 0 16px; }
  #bottom { gap: 4px; padding-inline: 8px; }
  #bottom button { font-size: 10px; }
}
@media (min-width: 768px) {
  #app .home-overview { grid-template-columns: minmax(0, 1.5fr) minmax(200px, 1fr); gap: 16px; }
  #app .home-overview .home-shortcuts { margin: 0; gap: 12px; }
  #app .home-overview .home-statistics-link { margin: 0; }
  #app .balance-hero { padding: 24px; }
  #app .home-overview .shortcut { min-height: 76px; padding: 20px; }
  .side-nav { gap: 8px; }
  #sidebar .side-nav button { padding: 12px 16px; }
}
@media (min-width: 1100px) {
  #site .home-overview { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
  #site .home-overview .next-game { padding: 28px; }
  #site .home-overview .hero-head h1 { font-size: 32px; }
  #site .home-overview .dashboard .card { padding: 24px; }
  #site .home-overview .match-bottom { gap: 16px; }
  #site .home-overview .match-bottom .when { gap: 16px; }
  #site .home-overview .match-bottom > .primary { margin-left: 0; width: 100%; text-align: center; }
  #app .layout { gap: 20px; }
}
@media (max-width: 480px) {
  #site .next-game { padding: 20px 16px; border-radius: 24px; }
  #site .next-game .teams { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: 8px; margin: 20px 0; }
  #site .next-game .teams > div:not(.vs) { grid-template-rows: 64px minmax(58px, auto) 20px; }
  #site .next-game .teams .team-logo { width: 64px; height: 64px; }
  #site .next-game .teams .team-logo img { width: 52px; height: 52px; }
  #site .next-game .teams h2 { font-size: 20px; }
  #site .next-game .vs { font-size: 28px; }
}

/* Consistent compact spacing, with touch targets kept at least 44px. */
#app .toolbar .tabs:has([data-action="calendar-mode"]) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  flex: 1 1 320px;
  gap: 4px;
}
#app [data-action="calendar-mode"] { width: 100%; min-width: 0; min-height: 44px; padding: 8px; }
#app .profile-menu {
  display: grid;
  gap: 0;
  padding: 4px 12px;
  overflow: visible;
}
#app .profile-menu-row, #app .profile-menu-row:last-child {
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  padding: 12px 4px;
  min-height: 60px;
  gap: 10px;
  height: auto;
  white-space: normal;
}
#app .profile-menu-row + .profile-menu-row { position: relative; }
#app .profile-menu-row + .profile-menu-row::after {
  content: ""; position: absolute; top: 0; left: 50px; right: 4px;
  height: 1px; background: var(--line); pointer-events: none;
}
#app .profile-menu-row:hover { background-color: #dceaf64d; }
#app .profile-menu-row .grow { overflow-wrap: anywhere; }
#app .profile-menu-row small { line-height: 1.4; margin-top: 3px; }
#app .profile-menu-row .chevron { flex: none; }
#app .profile-overview, #app .profile-settings-stack { gap: 12px; }
#app .profile-identity .profile-head { margin-bottom: 12px; }
#app .profile-mini-stats { margin-top: 12px; padding-top: 12px; }
#app .card:not(.profile-menu), #app .event-card { padding: 16px; }
#app .intro { margin-bottom: 16px; }
#app .intro h1 { font-size: clamp(28px, 3.5vw, 38px); }
#app .grid, #app .layout, #app .player-grid { gap: 12px; }
#app .tabs { margin-bottom: 12px; }
#app .balance-hero { padding: 18px; }
#app .balance-value { font-size: clamp(40px, 4vw, 48px); margin-block: 8px; }
#app .balance-hero > p { margin-bottom: 12px; }
#app .balance-hero .payment-shortcut { min-height: 48px; height: 48px; font-size: 21px; }
#app .shortcut { min-height: 48px; padding: 10px 12px; }
#app .home-overview .shortcut { min-height: 56px; }
#app .home-statistics-link { margin-bottom: 18px; }
#site .card, #site .home-overview .dashboard .card { padding: 20px; }
#site .home-overview { gap: 18px; }
#site .home-overview .dashboard { gap: 18px; }
#site .home-overview .next-game { padding: 24px; }
#site .page-title { padding-block: 16px 24px; }
#site .match-row { padding: 18px 20px; }
#site .roster, #site .photos { gap: 16px; }
@media (max-width: 767px) {
  #app .intro h1 { font-size: 29px; }
  #app .event-card h3 { font-size: 22px; margin-block: 10px; }
  #app .profile-identity .avatar.big { width: 60px; height: 60px; }
  #app .profile-identity .profile-head h2 { font-size: 25px; }
  #site .card { padding: 16px; }
  #site .home-overview .next-game { padding: 20px 16px; }
}

.external-arrow { display: inline-block; width: 18px; height: 18px; vertical-align: -.15em; flex: none; }
#site .next-game .teams h2 a { text-decoration: none; }
#site .next-game .teams h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
#site .next-game .teams h2 { overflow-wrap: anywhere; }
#app .balance-value { padding-inline: 0; background: none; border: 0; box-shadow: none; }
.balance-hero, .event-card { position: relative; }
.card-open { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-open:focus-visible { outline: 3px solid #357eff; outline-offset: 3px; }
.balance-hero .payment-shortcut, .event-card .rsvp { position: relative; z-index: 2; }
.balance-detail .icon { width: 16px; height: 16px; vertical-align: middle; }
#site .result-scoreline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 20px 0 12px; }
#site .result-scoreline > span { font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
#site .result-scoreline > span:last-child { text-align: right; }
#site .result-scoreline .score { font-size: 42px; margin: 0; white-space: nowrap; }
#site .result-summary > a { text-decoration: none; display: block; }
#site .result-link { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; }
#site :is(.result-summary, .season-summary, .standings-summary) h2,
#site :is(.result-summary, .season-summary, .standings-summary) h3 { font-size: 25px; margin: 8px 0 16px; }
#site :is(.season-summary, .standings-summary) .metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
#site :is(.season-summary, .standings-summary) .metrics > div { min-width: 0; padding: 12px 8px; border-radius: 14px; background: #ffffff70; box-shadow: inset 0 1px 0 #fff; }
#site :is(.season-summary, .standings-summary) .metrics strong { font-size: 32px; line-height: 1.2; }
#site :is(.season-summary, .standings-summary) .metrics small { display: block; font-size: 12px; line-height: 1.4; margin-top: 6px; overflow-wrap: anywhere; }
#site :is(.result-summary, .season-summary) p { font-size: 12px; line-height: 1.5; margin-block: 12px; }
#site .home-overview + .standings-summary { margin-top: 18px; margin-bottom: 28px; }
#site .standings-summary > p { font-size: 14px; }

/* Captain summary: separate figures from actions, keep strong contrast. */
#app .captain-overview { display: grid; gap: 12px; margin-bottom: 16px; min-width: 0; }
#app .captain-finance { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#app .captain-finance .metric { min-width: 0; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
#app .captain-finance .metric-label { color: #455a7a; font-size: 13px; line-height: 1.35; }
#app .captain-finance .metric strong { font-size: clamp(25px, 3.2vw, 34px); line-height: 1.15; margin: 0; color: #102447; overflow-wrap: anywhere; }
#app .captain-finance .metric small { color: #526680; font-size: 11px; line-height: 1.45; }
#app .captain-actions { display: grid; gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
#app :is(.captain-action,.captain-review) { display: flex; align-items: center; gap: 12px; padding: 16px; text-align: left; min-height: 76px; width: 100%; color: #102447; }
#app .captain-action-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
#app .captain-action-copy strong { font: 650 16px/1.3 Onest,sans-serif; text-transform: none; letter-spacing: 0; }
#app .captain-action-copy small { font: 400 12px/1.4 Onest,sans-serif; color: #526680; }
#app .captain-action-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #dceaff; color: #1752c4; flex: none; }
#app :is(.captain-action,.captain-review) > .icon { flex: none; width: 18px; height: 18px; }
#app .captain-review-count { font: 700 24px/1 'Fira Sans Extra Condensed',sans-serif; color: #164bb8; min-width: 28px; text-align: center; }
#app .captain-payment { color: #fff; background: linear-gradient(145deg,#2869df,#174bb4); border-color: #abcfff; box-shadow: inset 0 1px 1px #ffffffb0, inset 0 -1px 2px #0b327a55, 0 5px 14px -8px #174bb470; }
#app .captain-payment .captain-action-copy small { color: #ecf4ff; }
#app .captain-payment .captain-action-icon { color: #fff; background: #ffffff24; }
@media (max-width: 599px) {
  #app .captain-actions { grid-template-columns: 1fr; }
  #app .captain-finance .metric { padding: 14px; }
  #app .captain-finance .metric-label .icon { display: none; }
  #app :is(.captain-action,.captain-review) { min-height: 72px; padding: 14px; gap: 10px; }
}
@media (forced-colors: active) {
  #app .captain-payment { background: ButtonFace; color: ButtonText; border-color: ButtonText; }
  #app .captain-payment .captain-action-copy small { color: ButtonText; }
}

/* A single frosted surface contains all five destinations. */
#bottom {
  background: linear-gradient(155deg, #f8fbfff0, #dce9f6cf);
  border-color: #f3faffeb;
  box-shadow: 0 6px 24px -8px #1b385638, inset 0 -1px 0 #95aeca30;
}
@media (max-width: 767px) {
  #bottom { min-height: 66px; padding-block: 6px; }
  #bottom button { min-height: 52px; }
  #bottom button .icon { width: 25px; height: 25px; }
}
#bottom button { color: #29476a; background: transparent; box-shadow: none; }
#bottom button.active:not(.nav-home),
#bottom .nav-home.active .nav-home-symbol {
  background: linear-gradient(145deg, #326faa, #204f83);
  box-shadow: inset 0 1px 0 #c5e2fb66, 0 2px 5px #1a46702b;
}
#bottom button.active:not(.nav-home) { color: #fff; }
#bottom button.nav-home { padding: 0; }
#bottom .nav-home-symbol {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  border: 1px solid #f3faffcf;
  background: #f4faff55;
  box-shadow: inset 0 1px 2px #ffffffbf;
}
#bottom .nav-home-symbol .bolt {
  width: 22px;
  height: 31px;
  background: #29476a;
}
#bottom .nav-home.active .bolt { background: #fff; }

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  #bottom { background: #eff7ff; }
}
#bottom button:focus-visible { outline-color: #194783; }
.home-overview { display: block; }
@media (prefers-contrast: more) { #bottom { border: 2px solid #fff; } }
@media (forced-colors: active) {
  #bottom { background: Canvas; border: 1px solid ButtonText; }
  #bottom::before { display: none; }
  #bottom button { color: ButtonText; }
  #bottom button.active:not(.nav-home) { color: HighlightText; background: Highlight; }
  #bottom .nav-home-symbol, #bottom .nav-home.active .nav-home-symbol { background: Highlight; border-color: Highlight; }
  #bottom .nav-home-symbol .bolt, #bottom .nav-home.active .bolt { background: HighlightText; }
}

/* Matchup mark on the dark match card. */
#site .next-game .vs.vs-mark {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  justify-self: center;
  inline-size: 64px;
  block-size: 42px;
  color: #eaf7ff;
  font: italic 800 30px/1 "Fira Sans Extra Condensed", sans-serif;
  letter-spacing: .06em;
}
#site .next-game .vs-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid #6b92b8;
  border-block-start-color: #c0def3;
  border-radius: 6px;
  background: linear-gradient(155deg, #304b65, #152a43 56%, #0d1c30);
  box-shadow: inset 0 1px 0 #e3f6ff24, 0 4px 8px #020a1459;
  transform: skewX(-13deg);
}
@media (max-width: 650px) {
  #site .next-game .vs.vs-mark {
    inline-size: 38px;
    block-size: 30px;
    font-size: 22px;
  }
}
@media (forced-colors: active) {
  #site .next-game .vs-mark::before {
    border-color: CanvasText;
    background: Canvas;
  }
  #site .next-game .vs.vs-mark { color: CanvasText; }
}

/* Interactive list entries are individual surfaces, including player balances. */
:is(#app, #site, #modal) :is(button.list-row, a.list-row) {
  border: 1px solid #ffffffd9;
  border-radius: 16px;
  padding: 12px;
  min-height: 56px;
  white-space: normal;
}
:is(#app, #site, #modal) :is(button.list-row, a.list-row) + :is(button.list-row, a.list-row) {
  margin-top: 8px;
}
:is(#app, #site, #modal) :is(button.list-row, a.list-row) .grow {
  overflow-wrap: anywhere;
}
:is(#app, #site, #modal) :is(button.list-row, a.list-row) > .avatar {
  flex-shrink: 0;
}
@media (forced-colors: active) {
  :is(#app, #site, #modal) :is(button.list-row, a.list-row) { border-color: ButtonText; }
}


.calendar-viewport .calendar-navigation { grid-template-columns: 48px minmax(0, 1fr) auto 48px; }
.calendar-viewport .calendar-navigation [data-action="calendar-today"] { width: auto; padding-inline: 12px; font-size: 14px; }

/* The entire month stays above the mobile navigation, including six-week months. */
@media (max-width: 767px) {
  body[data-route="calendar"]:has(.calendar-viewport) .shell {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  body[data-route="calendar"]:has(.calendar-viewport) #header {
    height: calc(64px + env(safe-area-inset-top));
    min-height: 0;
  }
  #app .calendar-viewport {
    height: calc(100svh - 154px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 6px;
  }
  #app .calendar-viewport + .section-space { margin-top: calc(96px + env(safe-area-inset-bottom)); }
  #app .calendar-viewport .intro {
    margin: 0;
    min-height: 44px;
    align-items: center;
  }
  #app .calendar-viewport .intro h1 { font-size: 28px; margin: 0; }
  #app .calendar-viewport .intro p { display: none; }
  #app .calendar-viewport .intro button { min-height: 44px; padding: 8px 12px; font-size: 14px; }
  #app .calendar-viewport > * { min-width: 0; }
  #app .calendar-viewport .toolbar { margin: 0; gap: 4px; }
  #app .calendar-viewport .toolbar .tabs { margin: 0; padding: 3px; gap: 3px; flex-basis: 100%; }
  #app .calendar-viewport .tabs button { min-height: 40px; padding: 6px; font-size: 13px; }
  #app .calendar-viewport .calendar-filter-chips { padding: 2px 0; gap: 6px; }
  #app .calendar-viewport .calendar-filter-chips button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  #app .calendar-viewport [data-calendar-filter]:is([data-calendar-filter="training"], [data-calendar-filter="game"], [data-calendar-filter="kvl"])::before {
    content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px;
    background: #1689c9; box-shadow: 0 0 0 1px #fff8;
  }
  #app .calendar-viewport [data-calendar-filter="game"]::before { background: #e89d37; }
  #app .calendar-viewport [data-calendar-filter="kvl"]::before { background: #345be0; }
  #app .calendar-viewport .calendar-navigation {
    display: grid; grid-template-columns: 44px minmax(0,1fr) auto 44px;
    align-items: center; gap: 6px; margin: 0;
  }
  #app .calendar-viewport .calendar-period { font-size: clamp(16px,4.7vw,24px); margin: 0; white-space: nowrap; }
  #app .calendar-viewport .calendar-navigation button { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
  #app .calendar-viewport .calendar-navigation [data-action="calendar-today"] { width: auto; padding: 0 8px; font-size: 12px; }
  #app .calendar-viewport .calendar-tools { display: none; }
  #app .calendar-month-slot { container-type: size; min-height: 0; }
  #app .calendar-month-slot .calendar-card {
    --preview-space: 0px;
    padding: 10px; margin: 0; min-height: 0;
  }
  #app .calendar-month-slot .calendar-card:has(.calendar-upcoming) { --preview-space: 68px; }
  #app .calendar-viewport .month-grid {
    --calendar-cell: min(calc((100cqw - 44px) / 7), max(28px, calc((100cqh - 42px - var(--preview-space) - var(--calendar-weeks) * 3px) / var(--calendar-weeks))));
    width: max-content;
    height: auto;
    margin-inline: auto;
    grid-template-columns: repeat(7, var(--calendar-cell));
    grid-template-rows: 18px;
    grid-auto-rows: var(--calendar-cell);
    gap: 3px;
  }
  #app .calendar-viewport .day-name { padding: 0; font-size: 10px; align-self: center; }
  #app .calendar-viewport .calendar-day { min-height: 0; height: auto; padding: 6px; font-size: 14px; border-radius: 10px; }
  body[data-route="calendar"]:has(.calendar-viewport) #app > .footer-note { display: none; }
}

#app .calendar-upcoming { display: none; }
@media (max-width: 767px) {
  #app .calendar-upcoming { display: block; margin-top: 8px; }
  #app .calendar-upcoming a {
    display: grid; grid-template-columns: minmax(0, 1fr) auto 12px;
    align-items: center; gap: 8px; padding: 7px 12px; min-height: 52px;
    background:
      linear-gradient(90deg, #183248e8, #38556b91 55%, #1d364ee8),
      url("/textures/tidal-silver.webp?v=c1cde224a2e4b9cfa97cd3ab") 50% 82% / cover no-repeat #243f55;
    color: white; text-decoration: none; border-radius: 14px;
    box-shadow: inset 0 1px 1px #ffffff5c;
  }
  #app .calendar-upcoming-details { display: grid; gap: 2px; min-width: 0; }
  #app .calendar-upcoming-label, #app .calendar-upcoming small { color: #d7e8fb; font-size: 12px; line-height: 1.2; }
  #app .calendar-upcoming :is(strong, small) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #app .calendar-upcoming strong { font-size: 15px; line-height: 1.15; }
  #app .calendar-upcoming time { font-family: "Fira Sans Extra Condensed", sans-serif; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
  #app .calendar-upcoming-arrow { font-size: 20px; color: #c8dcf5; }
}
/* Short phones can scroll the full preview clear of the fixed navigation. */
@media (max-width: 767px) and (max-height: 700px) {
  #app .calendar-viewport:has(.calendar-upcoming) { height: auto; grid-template-rows: auto auto auto auto; }
  #app .calendar-month-slot:has(.calendar-upcoming) { container-type: inline-size; }
  #app .calendar-month-slot:has(.calendar-upcoming) .month-grid { --calendar-cell: calc((100cqw - 44px) / 7); }
}
@media (max-width: 767px) {
  .shell {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  #app .card:not(.profile-menu), #app .profile-menu,
  #app .event-card, #app .balance-hero {
    padding-inline: 12px;
  }
  #app .ms-chart-grid .ms-chart { padding-inline: 8px; }
}

/* A single optical layer follows the active pane, beneath its contents. */
[data-glass-light] {
  position: relative;
  isolation: isolate;
}
[data-glass-light] > .glass-response {
  --glass-ink: 53 106 150;
  --glass-glint: 251 254 255;
  --glass-strength: .85;
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  margin: 0;
  padding: 0;
  border-radius: inherit;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  opacity: 1;
  transition: opacity 140ms ease-out;
}
@starting-style {
  [data-glass-light] > .glass-response { opacity: 0; }
}
[data-glass-light] > .glass-response[data-leaving] { opacity: 0; }
.glass-response::before,
.glass-response::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  transition: opacity 140ms ease-out;
}
.glass-response::before {
  width: clamp(94px, 62%, 272px);
  height: clamp(66px, 92%, 170px);
  background: linear-gradient(112deg,
    transparent 21%, rgb(var(--glass-ink) / .15) 38%,
    rgb(var(--glass-glint) / .48) 48%, rgb(var(--glass-glint) / .19) 54%,
    rgb(var(--glass-ink) / .10) 67%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse closest-side, #000 3%, #000b 37%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side, #000 3%, #000b 37%, transparent 100%);
  opacity: var(--glass-strength);
  transform: translate3d(calc(var(--glass-x) - 50%), calc(var(--glass-y) - 50%), 0);
}
.glass-response::after {
  bottom: 0;
  width: clamp(64px, 54%, 186px);
  background:
    linear-gradient(90deg, transparent, rgb(var(--glass-glint) / .94) 46%, rgb(var(--glass-ink) / .27) 69%, transparent) top / 100% 2px no-repeat,
    linear-gradient(90deg, transparent 4%, rgb(var(--glass-ink) / .28) 38%, rgb(var(--glass-glint) / .68) 61%, transparent 94%) bottom / 100% 1px no-repeat;
  transform: translate3d(calc(var(--glass-x) - 50%), 0, 0);
}
.glass-response[data-contact]::before { opacity: 1; }
.glass-response[data-contact]::after { opacity: .64; }
@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  [data-glass-light] > .glass-response { display: none; }
}
:is(#bottom, #sidebar, .site-header) [data-glass-light] > .glass-response {
  --glass-strength: .56;
}
