/* Bracketr winter: decorative only; existing theme and semantic colours stay in charge. */
:root {
  --winter-ice: #9de4ff;
  --winter-glow: rgb(129 212 250 / 16%);
  --winter-snow: rgb(219 244 255 / 55%);
  --winter-wire: rgb(160 198 204 / 45%);
}
html.bracketr-theme-light {
  --winter-ice: #397da4;
  --winter-glow: rgb(61 148 190 / 12%);
  --winter-snow: rgb(56 123 157 / 35%);
  --winter-wire: rgb(70 102 112 / 45%);
}

/* Local colour properties animate only the bulbs, never the logo or page text. */
@property --winter-bulb-warm {
  syntax: "<color>";
  inherits: false;
  initial-value: #fff3ca;
}
@property --winter-bulb-cool {
  syntax: "<color>";
  inherits: false;
  initial-value: #bfeeff;
}
@keyframes bracketr-winter-twinkle {
  0%, 100% { --winter-bulb-warm: #fff3ca; --winter-bulb-cool: #76b6cc; }
  50% { --winter-bulb-warm: #a58d5e; --winter-bulb-cool: #dcf7ff; }
}

/* Slow alternating warmth and ice; no abrupt flashes or layout movement. */
.bracketr-winter-lights {
  position: fixed;
  inset: 0 0 auto;
  height: 19px;
  z-index: 150;
  pointer-events: none;
  background:
    radial-gradient(ellipse 3px 5px at 18px 9px, var(--winter-bulb-warm, #fff3ca) 70%, transparent 90%) 0 0 / 96px 19px repeat-x,
    radial-gradient(ellipse 3px 5px at 66px 9px, var(--winter-bulb-cool, #bfeeff) 70%, transparent 90%) 0 0 / 96px 19px repeat-x,
    radial-gradient(ellipse 12px 10px at 18px 9px, rgb(255 211 131 / 25%), transparent 90%) 0 0 / 96px 19px repeat-x,
    radial-gradient(ellipse 12px 10px at 66px 9px, rgb(151 224 255 / 20%), transparent 90%) 0 0 / 96px 19px repeat-x,
    linear-gradient(var(--winter-wire), var(--winter-wire)) 0 2px / 100% 1px no-repeat;
  animation: bracketr-winter-twinkle 6s ease-in-out infinite;
}

/* Snow stays in the outer gutters; no particles cross tables or forms. */
.bracketr-winter-snow {
  position: fixed;
  inset: -140px 0 0;
  z-index: 39;
  pointer-events: none;
  background:
    radial-gradient(circle at 7px 19px, var(--winter-snow) 1.5px, transparent 2px) 0 0 / 23px 140px,
    radial-gradient(circle at 20px 86px, var(--winter-snow) 1px, transparent 1.6px) 0 0 / 29px 140px;
  mask-image: linear-gradient(90deg, #000, transparent 27px, transparent calc(100% - 27px), #000);
  animation: bracketr-winter-snow 18s linear infinite;
}
@keyframes bracketr-winter-snow {
  to { transform: translateY(140px); }
}

/* Frost sits on the existing shell, without recolouring status or action controls. */
:root :is(.public-site-nav, .brk-topbar, .org-topbar, .master-topbar) {
  border-bottom-color: var(--winter-ice) !important;
  box-shadow: 0 1px 0 rgb(157 228 255 / 18%), 0 8px 26px var(--winter-glow);
}
html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) :is(.brk-topbar, .org-topbar, .master-topbar) {
  border-bottom-color: var(--winter-ice) !important;
  box-shadow: 0 1px 0 rgb(157 228 255 / 18%), 0 8px 26px var(--winter-glow) !important;
}

/* The signed-in shells share these classes across player and staff pages. */
html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) .brk-sidebar {
  background-image: radial-gradient(ellipse at 0 0, var(--winter-glow), transparent 65%) !important;
  box-shadow: inset -1px 0 0 var(--winter-ice), 6px 0 24px var(--winter-glow) !important;
}
html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) .brk-sidebar .brk-brand {
  background-image:
    radial-gradient(ellipse 2px 3px at 8px 5px, var(--winter-bulb-warm, #fff3ca) 70%, transparent 90%),
    radial-gradient(ellipse 2px 3px at 28px 5px, var(--winter-bulb-cool, #bfeeff) 70%, transparent 90%),
    linear-gradient(var(--winter-wire), var(--winter-wire)) !important;
  background-position: left bottom, left bottom, left bottom 10px !important;
  background-size: 40px 12px, 40px 12px, 100% 1px !important;
  background-repeat: repeat-x, repeat-x, no-repeat !important;
  animation: bracketr-winter-twinkle 7s ease-in-out -2s infinite;
}

/* Seasonal notification icon; retain each button, badge and accessible name.
   High-contrast mode uses the existing currentColor bell. */
@media screen and (forced-colors: none) {
:root :is(.bracketr-userbar__notice-btn, .public-account-bell) > span {
  display: none;
}
:root :is(.bracketr-userbar__notice-btn, .public-account-bell)::before {
  content: "";
  display: block;
  width: 22px;
  height: 26px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 46'%3E%3Cpath d='M25 10V5c0-5 6-5 6-1 0 2-2 3-4 3' fill='none' stroke='%23e5bc68' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M12 15h16v16c0 8-5 13-13 13H7c-7 0-7-10-1-12l6-2Z' fill='%23c83e4d' stroke='%236f2133' stroke-width='1.5'/%3E%3Cpath d='M13 17v14L7 34' fill='none' stroke='%23ec6b72' stroke-width='2' stroke-linecap='round'/%3E%3Crect x='9' y='9' width='21' height='9' rx='3' fill='%23f4f9ff' stroke='%23b9d2e2' stroke-width='1.5'/%3E%3Cpath d='M21 23v8m-4-4h8m-7-3 6 6m0-6-6 6' stroke='%23fce2ab' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(-10deg);
  transform-origin: 85% 5%;
  -webkit-mask: none;
  mask: none;
  animation: bracketr-winter-stocking 8s ease-in-out infinite;
}
}
@keyframes bracketr-winter-stocking {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(-4deg); }
}
html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) :is(.brk-dashboard-title, .registry-page-head, .master-page-heading,
  .org-heading, .calendar-hero, .team-workspace-header, .whats-header) {
  background-image: linear-gradient(105deg, var(--winter-glow), transparent 75%) !important;
  box-shadow: inset 0 1px 0 var(--winter-ice), inset 0 -1px 0 var(--winter-glow);
}
:root :is(.brk-card, .brk-stat-card, .team-card, .org-panel, .master-panel,
  .community-path, .community-event-card) {
  box-shadow: inset 0 1px 0 var(--winter-glow);
}
:root :is(.community-welcome, .auth-login-card) {
  background-image: radial-gradient(ellipse at 100% 0, var(--winter-glow), transparent 65%);
  box-shadow: inset 0 1px 0 var(--winter-ice);
}

/* On phones, keep the lights but leave the narrower content area free of snow. */
@media (max-width: 600px) {
  .bracketr-winter-snow { display: none; }
  .bracketr-winter-lights { opacity: .8; }
}
@media (prefers-reduced-motion: reduce) {
  .bracketr-winter-snow, .bracketr-winter-lights,
  :root .brk-sidebar .brk-brand,
  :root :is(.bracketr-userbar__notice-btn, .public-account-bell)::before { animation: none !important; }
}
@media print, (forced-colors: active) {
  .bracketr-winter-lights, .bracketr-winter-snow { display: none; }
  .bracketr-winter-lights, :root .brk-sidebar .brk-brand { animation: none !important; }
  html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) .brk-sidebar .brk-brand { background-image: none !important; }
  html:root body :is(.public-site-nav, .brk-sidebar, .brk-topbar, .org-topbar, .master-topbar,
    .community-welcome, .auth-login-card, .brk-dashboard-title, .registry-page-head,
    .master-page-heading, .org-heading, .calendar-hero, .team-workspace-header,
    .whats-header, .brk-card, .brk-stat-card, .team-card, .org-panel, .master-panel,
    .community-path, .community-event-card) {
    box-shadow: none !important;
    background-image: none !important;
  }
  html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) .brk-sidebar,
  html:root:is(.bracketr-theme-site, .bracketr-theme-dark, .bracketr-theme-light) body:has(.brk-sidebar) :is(.brk-topbar, .org-topbar, .master-topbar,
    .brk-dashboard-title, .registry-page-head,
    .master-page-heading, .org-heading, .calendar-hero, .team-workspace-header, .whats-header) {
    background-image: none !important;
    box-shadow: none !important;
  }
}
