:root {
  --ink: #071a19;
  --panel: #102a25f2;
  --panel2: #142e29;
  --gold: #ffcf85;
  --teal: #9be1c2;
}
body {
  background: linear-gradient(135deg, #122f2b, #071619 70%);
}
.login-screen {
  background-image: linear-gradient(90deg, #08171b33, #07161912), url('/winter-square.jpg');
  background-position: 68% center;
}
.login-panel {
  width: min(560px, 94vw);
  background: linear-gradient(145deg, #122c27f8, #0a171bf8);
  border-color: #ddad67;
}
.login-mark {
  height: 74px;
  color: #ffdc9c;
  font: 56px/1 Georgia, serif;
  text-shadow: 0 0 24px #eeb66580;
}
.login-panel h1 {
  font-family: Georgia, serif;
  font-size: clamp(29px, 5vw, 44px);
  font-weight: normal;
  color: #ffdc9c;
}
.login-tagline { margin-bottom: 23px; }
.common-scene,
.final-banner.city-lost,
.final-review .final-banner.city-lost,
.player-mode .sidebar-art {
  background: linear-gradient(#091c20a8, #071a20eb), url('/winter-square.jpg') center 55% / cover;
}
.final-banner.city-lost { filter: saturate(.65); }
.prize-progress {
  width: 100%;
  max-width: 680px;
  padding: 10px 0;
  text-align: left;
  font-size: .86rem;
}
.prize-progress label,
.prize-progress > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 14px;
}
.prize-progress strong { color: var(--gold-high); }
.prize-progress-track { position: relative; margin: 8px 1px 5px; }
.prize-progress progress {
  display: block;
  width: 100%;
  height: 12px;
  appearance: none;
  border: 0;
  border-radius: 100px;
  overflow: hidden;
  background: #0b2522;
}
.prize-progress progress::-webkit-progress-bar { background: #0b2522; }
.prize-progress progress::-webkit-progress-value {
  background: repeating-linear-gradient(90deg, #ffd48c 0 6px, #b7884d 6px 10px);
}
.prize-progress progress::-moz-progress-bar { background: #ffd48c; }
.prize-progress-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #f8f3e8;
}

.host-mode .sidebar {
  background: linear-gradient(180deg, #0b201f 28%, #0b201fd9 75%, #142b27),
    url('/winter-square.jpg') 76% bottom / auto 340px no-repeat;
}
.council-art { object-position: 72% center; }
.media-tile {
  background: linear-gradient(#0b211baa, #0b211be8), url('/winter-square.jpg') 70% center / cover;
}

:root {
  --ink:#0b1931;
  --panel:#172d4ded;
  --panel2:#203959;
  --gold:#d2e5fa;
  --gold-high:#f3f8ff;
  --teal:#a4d9ff;
  --line:#587ca2;
}
body { background:linear-gradient(150deg,#203d64,#0b1931 74%); }
.login-panel {
  background:linear-gradient(150deg,#1f3b60f8,#10233cf8);
  border-color:#b6d2ee;
}
.login-panel h1,.login-mark { color:#eaf6ff; text-shadow:0 0 20px #89c7ff80; }
.button-gold,
.player-mode .confirm-allocation {
  background:linear-gradient(180deg,#f3f8ff,#adc3dd);
  color:#122746;
  border-color:#f3f8ff;
  text-shadow:none;
  box-shadow:inset 0 1px #fff,0 3px 12px #091b35a8;
}
.player-mode .confirm-allocation:hover:not(:disabled) { background:#edf7ff; }
.host-mode .sidebar,.player-mode .sidebar {
  background:linear-gradient(180deg,#132947,#0c1b32 73%);
}
.common-scene,.final-banner.city-lost,.final-review .final-banner.city-lost {
  background:linear-gradient(#1e3d5d62,#102441e6),url('/winter-square.jpg') center / cover;
}
.media-tile {
  background:linear-gradient(#17345177,#10243dcb),url('/winter-square.jpg') 72% center / cover;
}
.media-annual-idle { background-color:#193553; }
:is(.host-mode,.player-mode) .district-badge {
  --ornament:#b95668;
  background:radial-gradient(circle at 37% 39%,#ffffff52,transparent 34%),
    radial-gradient(circle at 50% 58%,var(--ornament) 0 47%,transparent 49%);
  clip-path:none;
  box-shadow:none;
}
:is(.host-mode,.player-mode) .district-badge::after { display:none; }
:is(.host-mode,.player-mode) .district-badge .district-seal {
  width:100%;height:100%;transform:none;filter:drop-shadow(0 2px 3px #10213d);
}
:is(.host-mode,.player-mode) .badge-blue { --ornament:#326ba8; }
:is(.host-mode,.player-mode) .badge-green { --ornament:#338980; }
:is(.host-mode,.player-mode) .badge-amber { --ornament:#a86a33; }
:is(.host-mode,.player-mode) .badge-violet { --ornament:#7455ad; }
:is(.host-mode,.player-mode) .badge-rose { --ornament:#a9438c; }
.challenge-illustration { aspect-ratio:1; border-color:#bdd7f4; }
:is(.challenge-dialog,.trial-waiting,.relay-game,.grid-playing) {
  border-top-color:#e5f4ff;
  box-shadow:inset 0 3px #e2f2ff7c,0 5px 18px #0b1931ab;
}
.grid-playing .grid-layout {
  background:linear-gradient(#15325191,#173352c9),url('/winter-square.jpg') 68% center / cover;
}
.grid-playing .grid-tile {
  background:linear-gradient(145deg,#263f5de8,#132b48ef);
  border-color:#4e6b8c;
}
.grid-playing .grid-tile.grid-powered { background:linear-gradient(145deg,#214c61,#15334a); }
.grid-playing .grid-tile:not(.grid-powered) .grid-conductor { stroke:#7f9db8; }
.grid-playing .grid-tile:not(.grid-powered) .grid-contact-strip { stroke:#a5bbce; }
.grid-playing .grid-cable-junction { fill:#213854; }
.grid-playing .grid-tile:not(.grid-powered) .grid-cable-junction { stroke:#91adc7; }
.grid-playing .grid-powered g:not(.grid-cable-open) .grid-conductor {
  stroke:#5bffc9;
  filter:drop-shadow(0 0 3px #38ffc4);
}
.grid-playing .grid-powered g:not(.grid-cable-open) .grid-conductor-1 { stroke:#e0fff6; }
.grid-playing .grid-powered .grid-contact-strip { stroke:#b4ffe8; }
.grid-site { min-height:92px; overflow:hidden; isolation:isolate; }
.grid-site-photo {
  position:absolute;inset:0;z-index:-2;max-height:none;aspect-ratio:auto;
  background:url('/grid-art.jpg') var(--photo-x) var(--photo-y) / 300% 300% no-repeat;
  filter:none;
}
.grid-site::after {
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,#091932e8,#10274280 52%,transparent);
}
.grid-site>strong,.grid-site>span { color:#fff;text-shadow:0 1px 4px #020b16; }
.relay-game .relay-game-side:not(.relay-archive),.relay-game .relay-energy-console {
  background:linear-gradient(145deg,#244565,#112841);
  border-color:#708fb1;
}
.relay-radar {
  border-color:#bbd9f8;
  background:
    linear-gradient(90deg,transparent 49.8%,#98d6ff70 50%,transparent 50.2%),
    linear-gradient(0deg,transparent 49.8%,#98d6ff70 50%,transparent 50.2%),
    repeating-radial-gradient(circle,transparent 0 16%,#93ccff66 16.2% 16.5%,transparent 16.8% 17.5%),
    radial-gradient(circle,#304e78,#172f51 66%,#142440);
  box-shadow:0 0 0 4px #193453,0 0 0 6px #a0b9d7,0 0 24px #89ccff70;
}
.relay-radar::before {
  background:conic-gradient(transparent 75%,#85bdff18 83%,#9ad7ff66 96%,#e0f6ff 99.85%,transparent);
}
.relay-radar-unit .relay-radar-status { color:#e9f4ff;background:#263f61;border-color:#789dc6; }
.relay-game .relay-scope { --phosphor:#c1e5ff;background:#133153;border-color:#6b8fb8; }

.winter-fireworks { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.winter-fireworks i {
  position:absolute; left:75%; top:21%; width:4px;height:4px;border-radius:50%;
  color:#aadfff;background:currentColor;
  box-shadow:0 -29px,20px -20px,29px 0,20px 20px,0 29px,-20px 20px,-29px 0,-20px -20px;
  animation:winter-firework 1.3s ease-out both;
}
.winter-fireworks i:nth-child(2) { left:89%;top:41%;color:#ffe297;animation-delay:.2s; }
.winter-fireworks i:nth-child(3) { left:83%;top:12%;color:#f6f8ff;animation-delay:.38s; }
@keyframes winter-firework {
  0% { opacity:0;transform:scale(.12); }
  22% { opacity:.93; }
  100% { opacity:0;transform:scale(1.45); }
}
@media(prefers-reduced-motion:reduce) { .winter-fireworks { display:none; } }
@media(max-width:700px) {
  .grid-site { min-height:75px; }
}
.grid-site { aspect-ratio:1; }
.grid-playing .grid-layout::before { content:none; }
.grid-site { align-content:start; display:grid; align-items:start; }
.grid-site-photo { display:block; }
.grid-playing .grid-targets { background:#193351eb; }

.main-screen :is(.media-panel,.council-panel,.standalone-panel,.video-room-panel,.host-task-panel) {
  border-top-color:#dcecff;
  box-shadow:inset 0 2px #e4f4ff96,0 4px 18px #07142a56;
}
@media(max-width:700px) {
  .grid-site>strong,.grid-site>span { align-self:start; }
}
.login-mark img { height:76px;width:76px;filter:drop-shadow(0 0 12px #b5ddff6b); }
:is(.host-mode,.player-mode) .nav-link.selected {
  color:#f7fbff;
  background:linear-gradient(100deg,#405f87,#29466c);
  border-color:#accced;
}
.grid-playing .power-grid { margin:0 auto; }
@media(min-width:811px) {
  .grid-playing .grid-sites {
    grid-template-columns:repeat(2,minmax(0,112px));
    justify-content:center;
  }
}

/* Shared cabinet header and continuous winter scene. */
body:is(.host-mode,.player-mode) {
  --cabinet-header-height:clamp(136px,12vw,180px);
}
:is(.host-mode,.player-mode) #game {
  isolation:isolate;
  position:relative;
}
:is(.host-mode,.player-mode) #game {
  background:#132845;
}
:is(.host-mode,.player-mode) #game::before {
  content:"";
  position:fixed;
  z-index:-1;
  inset:0;
  height:auto;
  background:linear-gradient(180deg,#162d4f85,#122948b8 64%,#142747c2),
    url('/winter-cabinet.jpg') center / cover no-repeat;
}
:is(.host-mode,.player-mode) .game-header {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  height:var(--cabinet-header-height);
  padding:0 clamp(10px,2vw,30px);
  border-bottom:1px solid #c5dfff8a;
  background:
    radial-gradient(ellipse at center,#102641bd 0%,#142b4766 31%,transparent 66%),
    linear-gradient(0deg,#0d234580,#1739541c 56%),
    url('/winter-cabinet.jpg') center 42% / cover no-repeat;
}
:is(.host-mode,.player-mode) .game-header::after {
  height:1px;
  background:linear-gradient(90deg,transparent,#ffd893c9 32%,#ecf7ff 50%,#ffdb94c9 68%,transparent);
  box-shadow:0 0 9px #b2dbff86;
}
:is(.host-mode,.player-mode) .header-brand {
  position:static;
  grid-column:2;
  background:transparent;
  min-width:0;
  left:auto;
  transform:none;
  padding:0;
  gap:clamp(10px,1.8vw,23px);
  clip-path:none;
}
:is(.host-mode,.player-mode) .header-brand .host-header-seal {
  width:clamp(68px,7vw,115px);
  height:clamp(68px,7vw,115px);
  max-height:none;
  filter:drop-shadow(0 0 16px #9fcbfb85);
}
:is(.host-mode,.player-mode) .header-brand-title strong {
  font-size:clamp(25px,2.9vw,45px);
  line-height:.99;
  color:#f6faff;
  text-shadow:0 2px 6px #081a37,0 0 24px #badfff70;
}
:is(.host-mode,.player-mode) .header-status {
  grid-column:3;
  justify-self:end;
  align-self:end;
  margin:0 0 13px;
  background:#0d2545e6;
}
:is(.host-mode,.player-mode) .game-shell {
  min-height:calc(100vh - var(--cabinet-header-height));
  min-height:calc(100dvh - var(--cabinet-header-height));
}
:is(.host-mode,.player-mode):not(.playing-challenge) .sidebar {
  background:linear-gradient(150deg,#162f52ed,#10223cba);
}

/* Small clusters of bulbs, placed on a few cabinet panels. */
:is(.host-mode,.player-mode):not(.playing-challenge) :is(.allocation-panel,.opening-room,.host-task-panel,.council-panel,.media-panel) {
  position:relative;
  --garland-left: auto;
  --garland-right:20px;
  background-color:#192f50ec;
}
:is(.host-mode,.player-mode):not(.playing-challenge) :is(.allocation-panel,.host-task-panel) {
  --garland-left:24px;
  --garland-right:auto;
}
:is(.host-mode,.player-mode):not(.playing-challenge) :is(.allocation-panel,.opening-room,.host-task-panel,.council-panel,.media-panel)::after {
  content:"";
  position:absolute;
  inset:0 var(--garland-right) auto var(--garland-left);
  width:clamp(94px,19vw,250px);
  height:8px;
  z-index:1;
  pointer-events:none;
  background:
    radial-gradient(circle at 12% 42%,#fff2c6 0 1.2px,#ffbc56 2px,transparent 3.8px),
    radial-gradient(circle at 31% 51%,#ffe8ee 0 1.2px,#e98da8 2px,transparent 3.8px),
    radial-gradient(circle at 52% 35%,#f4fbff 0 1.2px,#9ce6ff 2px,transparent 3.8px),
    radial-gradient(circle at 70% 52%,#fff3ca 0 1.2px,#ffca68 2px,transparent 3.8px),
    radial-gradient(circle at 88% 40%,#e9f6ff 0 1.2px,#a1c6ff 2px,transparent 3px);
  filter:drop-shadow(0 0 4px #ffd89c);
  animation:cabinet-lights 5.8s ease-in-out infinite alternate;
}
:is(.opening-room,.council-panel)::after { animation-delay:-2.9s!important; }
@keyframes cabinet-lights {
  0%,17% { opacity:.62;filter:drop-shadow(0 0 2px #ffd89c); }
  57%,100% { opacity:1;filter:drop-shadow(0 0 6px #ffd89c); }
}
@media(max-width:980px) {
  :is(.host-mode,.player-mode) .game-header {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:1fr auto;
    justify-items:center;
  }
  :is(.host-mode,.player-mode) .header-brand,
  :is(.host-mode,.player-mode) .header-status { grid-column:1; }
  :is(.host-mode,.player-mode) .header-status { justify-self:center;margin-bottom:7px; }
}
@media(prefers-reduced-motion:reduce) {
  :is(.allocation-panel,.opening-room,.host-task-panel,.council-panel,.media-panel)::after {
    animation:none!important;
  }
}
:is(.host-mode,.player-mode):not(.playing-challenge) .main-screen {
  background:linear-gradient(160deg,#12294938,#11254155 75%);
}
body.player-mode.playing-challenge {
  --cabinet-header-height:92px;
}
.player-mode.playing-challenge .header-brand .host-header-seal {
  width:58px;height:58px;
}
.player-mode.playing-challenge .header-brand-title strong {
  font-size:clamp(20px,2vw,29px);
}
@media(max-width:980px) {
  body.player-mode.playing-challenge { --cabinet-header-height:120px; }
}
