.boss-hacked-projector,.boss-restored-flag {display:none;}
.boss-hacked .gbl-projector :is(.gbl-earth,.gbl-hologram-topic) {visibility:hidden;opacity:0;}
.boss-hacked .gbl-projector-light {background:radial-gradient(ellipse,#ff958bad,#ec23384f 42%,transparent 72%);}
.boss-hacked .gbl-projector-rings {border-color:#ff9ca5;box-shadow:0 0 12px #ff334a99;}
.boss-hacked .gbl-projector-beam {background:linear-gradient(to top,#ff426da6,#ff31451f,transparent);}
.boss-hacked-projector {
  position:absolute;
  left:50%;
  bottom:14px;
  translate:-50%;
  width:43%;
  margin:0;
  color:#ffb5c3;
  text-align:center;
}
.boss-hacked .boss-hacked-projector {display:block;animation:boss-intrusion 1s ease-out both;}
.boss-hacked-projector img {
  display:block;width:100%;
  filter:drop-shadow(0 0 9px #f52850) saturate(.65);
  mask-image:linear-gradient(#000 88%,transparent);
  animation:boss-hologram-drift 3s ease-in-out infinite;
}
.boss-hacked-projector figcaption {
  white-space:nowrap;font:800 clamp(.5rem,1vw,.8rem) var(--body);
  text-shadow:0 1px 4px #5b0019;
}
.boss-hacked::after,.boss-alert::before {
  content:"";position:absolute;inset:0;pointer-events:none;
  z-index:920;
  background:radial-gradient(ellipse,transparent 38%,#9f063d3b);
}
.boss-alert::before {z-index:940;animation:boss-red-alert 2.4s ease-in-out both;}
.boss-restored .boss-restored-flag {
  display:block;position:absolute;z-index:1;left:50%;bottom:25px;translate:-50%;
  width:25%;filter:drop-shadow(0 0 11px #fff19d);
}
.boss-celebration .gbl-speaker-name {animation:boss-applause 1.2s ease-in-out 2;}
@keyframes boss-red-alert {0%,100%{opacity:0;}25%,65%{opacity:.7;}45%{opacity:.15;}}
@keyframes boss-intrusion {from{opacity:0;scale:.8;translate:-50% 18%;}40%{opacity:.2;translate:-53% 0;}to{opacity:1;scale:1;translate:-50% 0;}}
@keyframes boss-hologram-drift {50%{transform:translateY(-3px);}}
@keyframes boss-applause {40%{box-shadow:0 0 15px #ffed91;transform:translateY(-2px);}}

dialog.sheet.wood-sheet.gbl-boss-sheet {
  position:fixed;inset:0;margin:0;
  width:100vw;height:100dvh;max-width:none;max-height:none;
  padding:0;border:0;border-radius:0;
  overflow:hidden;scrollbar-gutter:auto;
  background:transparent;box-shadow:none;transform:none;
  color:#fff1d0;
}
.gbl-boss-sheet::backdrop {background:#180d2d3b;}
.gbl-boss-sheet > .sheet-inner {
  position:absolute;inset:0;display:flex;flex-direction:column;
  padding:0;overflow:hidden;pointer-events:none;
}
.gbl-boss-sheet > .sheet-inner > .close,
.gbl-boss-sheet > .sheet-inner > h2,
.gbl-boss-sheet > .sheet-inner > .eyebrow {display:none;}
.gbl-boss-sheet .boss-story {
  position:absolute;left:50%;bottom:5.2%;translate:-50%;
  width:min(880px,92vw);
  max-height:min(44dvh,390px);
  display:flex;flex-direction:column;
  padding:clamp(13px,1.4vw,24px);
  border:4px solid #6f3c22;
  border-radius:15px;
  color:#512d20;
  background:linear-gradient(145deg,#fff3cf,#f2d291);
  box-shadow:inset 0 0 0 2px #e4b96c,0 5px 0 #3a2018,0 13px 30px #1f092573;
  font:700 clamp(.9rem,1.3vw,1.2rem)/1.42 var(--body);
  pointer-events:auto;
}
.boss-story-head {
  display:flex;gap:12px;align-items:center;justify-content:space-between;
  margin-bottom:.4em;flex:none;
}
.boss-story-head strong {font:800 1.45em/1.05 var(--display);color:#652e1d;}
.boss-story-head span {font-size:.76em;font-weight:800;text-align:right;}
.boss-story-lines {overflow:auto;min-height:0;scrollbar-color:#95603b #f7deaa;}
.gbl-boss-sheet .boss-story p {margin:.28em 0;font-size:inherit;}
.boss-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:.6em;flex:none;margin-top:.75em;}
.boss-actions .adv-button {font-size:1.04em;min-height:40px;}
.boss-rules .boss-story,.boss-paused .boss-story,.boss-defeat .boss-story {
  bottom:50%;translate:-50% 50%;max-height:76dvh;
}
.boss-rules::backdrop,.boss-paused::backdrop {background:#0d1639c2;}
.boss-defeat::backdrop {background:#210821ca;}
.gbl-boss-sheet.boss-defeat .boss-story {
  color:#f7e3d0;background:linear-gradient(145deg,#261a3d,#331829);border-color:#8f3d58;
  box-shadow:inset 0 0 0 2px #d87567,0 14px 55px #5b072b;
}
.boss-defeat .boss-story-head strong {color:#ffa8a8;}
.boss-defeat .boss-actions button {
  background:linear-gradient(#2e9bb7,#155b7b);
  border-color:#153b55;box-shadow:inset 0 0 0 2px #9cfaff,0 3px 0 #101b37,0 0 22px #52ecf359;
}
.boss-retry-copy {text-align:center;color:#f7e1a9;}
.gbl-boss-sheet.boss-victory .boss-story {border-color:#aa7024;}
.boss-victory::backdrop {background:#27442912;}

/* The arena and its answer console are a single screen-sized game surface. */
.gbl-boss-sheet.boss-battle::backdrop {background:#091326;}
.gbl-boss-sheet .boss-arena-ui {
  position:absolute;inset:0;
  display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;
  padding:clamp(9px,1.7vw,24px);
  gap:clamp(5px,.9dvh,12px);
  pointer-events:auto;
  background:linear-gradient(130deg,#081e30,#19102d);
  font-family:var(--body);
}
.boss-battle-header {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  width:min(1240px,100%);margin:auto;
  color:#d5f9ff;
  font:800 clamp(.86rem,1.5vw,1.4rem)/1.1 var(--display);
}
.boss-battle-header > span {text-shadow:2px 2px #2a092a;letter-spacing:.05em;}
.boss-battle-header .adv-button {font-size:.77em;min-height:34px;padding:.25em .8em;}
.boss-countdown {
  padding:.25em .6em;border:2px solid #2b8da9;background:#102c46;
  box-shadow:3px 3px #051221;color:#c1ffef;
  font:800 clamp(1.1rem,2.25vw,1.7rem)/1 var(--display);
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.boss-countdown small {font:800 .57em var(--body);}
.boss-countdown.urgent {color:#ffd0b7;border-color:#ea7455;}
.boss-question {
  width:min(1240px,100%);margin:0 auto;
  padding:clamp(10px,1.25vw,18px);
  border:3px solid #936d53;border-radius:4px;
  box-shadow:inset 0 0 0 2px #f3d5a0,4px 4px #060c23;
  background:linear-gradient(#fff1ce,#f5dfab);
  color:#452a26;
}
.gbl-boss-sheet .boss-falsehood {
  margin:0 0 .33em;
  color:#7b3d44;font:700 clamp(.72rem,1.1vw,1rem)/1.36 var(--body);
}
.boss-falsehood strong {
  display:inline-block;margin-right:.4em;padding:.13em .4em;
  color:#fff0d4;background:#903341;font-weight:800;border-radius:3px;
}
.gbl-boss-sheet .boss-question h3 {
  margin:0;
  font:800 clamp(.97rem,1.7vw,1.5rem)/1.17 var(--display);
  color:#422526;
}
.boss-arena {
  position:relative;isolation:isolate;
  width:min(1240px,100%);margin:0 auto;min-height:0;overflow:hidden;
  border:2px solid #2c5170;border-radius:4px;
  background:#0a2037 url("assets/forum/battle-arena.webp") center 54% / cover no-repeat;
  image-rendering:pixelated;
}
.boss-arena::after {
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(transparent,#04192f30);
}
.boss-hp {
  position:absolute;z-index:5;
  width:28%;min-width:185px;max-width:355px;
  padding:clamp(8px,1.25vw,15px);
  border:3px solid #2e3c52;
  box-shadow:inset 0 0 0 2px #87d6c3,4px 4px #06172d;
  background:linear-gradient(135deg,#f6f2d8,#d4e2cb);
  color:#1c3a42;
}
.boss-hp-enemy {right:4%;bottom:8%;}
.boss-hp-player {left:4%;top:1%;}
.boss-hp > strong {display:block;font:800 clamp(.8rem,1.4vw,1.25rem)/1.08 var(--display);}
.boss-hp > b {display:block;text-align:right;font:800 clamp(.67rem,1vw,.94rem)/1.2 var(--body);}
.boss-hp-track {
  height:clamp(9px,1.5dvh,16px);margin:.4em 0;
  padding:2px;border:2px solid #244c53;background:#385154;
}
.boss-hp-track > span {
  display:block;height:100%;width:100%;
  background:linear-gradient(#b2f0a1,#40b797);
  transition:width .78s cubic-bezier(.22,.62,.38,.99);
}
.boss-hp-enemy .boss-hp-track > span {background:linear-gradient(#ffa1bf,#cb4d83);}
.boss-enemy {
  position:absolute;z-index:3;
  left:72%;top:4%;height:66%;width:23%;
  transform-origin:center bottom;
}
.boss-enemy img {
  width:100%;height:100%;object-fit:contain;object-position:center bottom;
  image-rendering:pixelated;filter:drop-shadow(4px 5px 0 #070d2277);
}
.boss-hero {
  position:absolute;left:12%;bottom:3%;height:75%;width:24%;
  transform-origin:center bottom;z-index:3;
}
.boss-hero canvas {
  width:100%;height:100%;object-fit:contain;object-position:center bottom;image-rendering:pixelated;
  filter:drop-shadow(4px 4px 0 #06223188);
}
.boss-console {
  position:relative;
  width:min(1240px,100%);margin:auto;
  padding:clamp(7px,1vw,14px);
  border:3px solid #8b6650;
  box-shadow:inset 0 0 0 2px #e3bc7f,4px 4px #050b1c;
  background:#e8dab8;
}
.boss-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
.boss-answer {
  display:flex;align-items:center;gap:.65em;
  padding:clamp(9px,1vw,15px);
  min-height:62px;
  border:2px solid #5f4438;border-radius:4px;
  box-shadow:2px 2px #3a2a29;
  background:#fff4d5;color:#3e2b2b;
  font:800 clamp(.78rem,1.2vw,1.05rem)/1.3 var(--body);
  text-align:left;cursor:pointer;touch-action:manipulation;
}
.boss-answer > b {
  flex:none;display:grid;place-items:center;width:1.8em;height:1.8em;
  border:1px solid #9e7049;border-radius:3px;background:#eacc91;color:#5c3226;
}
.boss-answer:hover:enabled,.boss-answer:focus-visible {outline:3px solid #43d6dd;outline-offset:-2px;}
.boss-answer:disabled {cursor:default;}
.boss-answer.answer-correct {background:#bbebc6;border-color:#21644e;}
.boss-answer.answer-wrong {background:#f5c5a7;border-color:#a25340;}
.boss-feedback[hidden] {display:none;}
.boss-feedback {
  position:absolute;inset:0;z-index:10;
  display:flex;flex-direction:column;justify-content:center;
  padding:clamp(8px,1.3vw,18px);
  border:2px solid #52bcae;background:#fff0cd;
  color:#3c3930;overflow:auto;
  font-size:clamp(.73rem,1.1vw,1.02rem);
}
.boss-feedback > strong {font:800 1.35em/1 var(--display);color:#19575c;}
.gbl-boss-sheet .boss-feedback p {margin:.3em 0;font-size:inherit;line-height:1.27;}
.gbl-boss-sheet .boss-feedback .boss-reaction {color:#724051;font-size:.91em;}
.boss-feedback small {color:#657356;font-size:.76em;}
.boss-attack {
  position:absolute;z-index:7;left:29%;top:70%;width:50%;height:8px;
  transform:rotate(-26deg);transform-origin:left;opacity:0;
  background:#c9ffff;box-shadow:0 0 13px 5px #27ddec;
}
.boss-damage {
  position:absolute;z-index:9;left:78%;top:18%;opacity:0;
  color:#ffbebc;text-shadow:2px 2px #44152b;
  font:800 clamp(1rem,2vw,2.1rem) var(--display);
}
.boss-hit-enemy .boss-attack {animation:boss-evidence-beam .9s .1s ease both;}
.boss-hit-player .boss-attack {
  left:76%;top:31%;transform:rotate(151deg);background:#ffc0b5;
  box-shadow:0 0 15px 5px #df3664;animation:boss-evidence-beam .9s .1s ease both;
}
.boss-hit-enemy .boss-enemy {animation:boss-pixel-hit .68s .35s ease-out both;}
.boss-hit-player .boss-hero {animation:boss-pixel-hit .68s .35s ease-out both;}
.boss-hit-enemy .boss-damage,.boss-hit-player .boss-damage {animation:boss-damage-float 1.3s .3s ease-out both;}
.boss-hit-player .boss-damage {left:22%;top:62%;}
.boss-final .boss-arena::after {z-index:0;background:#310b3026;}
.boss-final .boss-battle-header > span {color:#ffd0be;}
.boss-critical .boss-attack {height:18px;box-shadow:0 0 32px 16px #43e7f2;}
.boss-critical .boss-hero {animation:boss-golden 1.1s ease-out both;}
.boss-critical .boss-enemy {animation:boss-pixel-defeat 1.4s .5s ease-out forwards;}
.boss-fact-symbols {position:absolute;z-index:8;inset:42% 51% 0 0;display:flex;gap:4px;opacity:0;align-items:center;justify-content:center;pointer-events:none;}
.boss-fact-symbols i {padding:4px;border:1px solid #b6ffff;background:#095f7ecf;color:#eafffd;font:800 clamp(.55rem,1vw,.9rem) var(--body);font-style:normal;}
.boss-critical .boss-fact-symbols {animation:boss-symbols 1.5s ease-out both;}
@keyframes boss-pixel-hit {20%,65%{filter:sepia(1) saturate(5) hue-rotate(315deg);translate:5px 0;}40%{translate:-4px 0;}to{translate:0;}}
@keyframes boss-pixel-defeat {0%,25%{filter:brightness(2) sepia(1) saturate(4);}50%{opacity:.8;transform:scaleX(.92);clip-path:inset(15% 0 0);}75%{opacity:.5;clip-path:inset(45% 0 0);}to{opacity:0;transform:scaleX(1.1);clip-path:inset(100% 0 0);}}
@keyframes boss-evidence-beam {0%{opacity:0;scale:0 1;}40%{opacity:1;scale:1 1;}75%{opacity:1;}to{opacity:0;scale:1 .1;}}
@keyframes boss-damage-float {0%{opacity:0;translate:0 8px;}25%{opacity:1;}to{opacity:0;translate:0 -28px;}}
@keyframes boss-golden {35%,60%{filter:drop-shadow(0 0 12px #ffd47d) brightness(1.5);}}
@keyframes boss-symbols {25%,66%{opacity:1;}to{opacity:0;transform:translateY(-15px);}}

.gbl-boss-sheet.boss-rewind::backdrop {background:#0f3b7ee6;}
.boss-rewind-clock {
  position:absolute;left:50%;top:43%;translate:-50% -50%;width:min(35vw,29dvh);aspect-ratio:1;
  border:8px double #b2fbff;border-radius:50%;
  background:repeating-conic-gradient(#70cbd7 0 2deg,transparent 2deg 30deg),radial-gradient(#0a3355,#0e2365);
  box-shadow:0 0 40px #43cfe9a1,inset 0 0 0 8px #102750;
}
.boss-rewind-clock i,.boss-rewind-clock b {
  position:absolute;left:49%;bottom:50%;width:5px;height:36%;
  border-radius:4px;background:#d3fbff;transform-origin:bottom center;animation:boss-clock-back 1.5s linear both;
}
.boss-rewind-clock b {height:24%;animation-duration:2.3s;}
.boss-rewind-label {position:absolute;top:65%;width:100%;text-align:center;color:#efffff;font:800 1.5rem var(--display);}
@keyframes boss-clock-back {from{rotate:0deg;}to{rotate:-540deg;}}
.boss-rewinding {animation:boss-reverse .9s ease-in-out 2;}
@keyframes boss-reverse {50%{filter:hue-rotate(18deg) saturate(.5);}}
@media (max-aspect-ratio:6/5) {
  .gbl-boss-sheet .boss-story {bottom:4%;max-height:51dvh;padding:13px;font-size:.87rem;}
  .boss-story-head {align-items:start;}
  .boss-story-head span {font-size:.69em;}
  .gbl-boss-sheet .boss-arena-ui {padding:8px;gap:7px;}
  .boss-battle-header {gap:5px;font-size:.85rem;}
  .boss-battle-header .adv-button {font-size:.75rem;}
  .gbl-boss-sheet .boss-falsehood {font-size:.72rem;line-height:1.31;}
  .gbl-boss-sheet .boss-question h3 {font-size:1.01rem;}
  .boss-question {padding:10px;}
  .boss-arena {background-position:center;}
  .boss-hp {width:47%;min-width:0;padding:7px;border-width:2px;}
  .boss-hp-enemy {right:3%;bottom:4%;}
  .boss-hp-player {left:3%;top:1%;}
  .boss-enemy {left:63%;top:6%;height:58%;width:32%;}
  .boss-hero {left:5%;width:40%;height:66%;bottom:3%;}
  .boss-answer {min-height:68px;padding:7px;gap:6px;font-size:.73rem;line-height:1.25;}
  .boss-answer > b {width:1.5em;height:1.5em;}
  .boss-feedback {font-size:.78rem;}
  .boss-fact-symbols {inset:40% 25% 0 0;flex-wrap:wrap;align-content:center;}
  .boss-rules .boss-story,.boss-paused .boss-story,.boss-defeat .boss-story {bottom:50%;max-height:82dvh;}
  .boss-hacked-projector {width:40%;bottom:5px;}
}
@media (max-height:540px) and (min-aspect-ratio:6/5) {
  .gbl-boss-sheet .boss-arena-ui {padding:6px;gap:4px;}
  .boss-answer {min-height:42px;padding:6px;font-size:.75rem;}
  .boss-battle-header {font-size:.8rem;}
  .boss-countdown {font-size:1rem;}
  .boss-battle-header .adv-button {min-height:27px;}
  .gbl-boss-sheet .boss-question h3 {font-size:.98rem;}
  .gbl-boss-sheet .boss-falsehood {font-size:.65rem;line-height:1.2;}
  .boss-question {padding:6px 9px;}
  .boss-hp {padding:5px;min-width:130px;}
  .boss-hp > strong {font-size:.75rem;}
  .boss-hp > b {font-size:.62rem;}
  .boss-hp-track {margin:3px 0;}
  .gbl-boss-sheet .boss-story {font-size:.77rem;max-height:49dvh;padding:9px 14px;bottom:3%;}
  .boss-actions {margin-top:.4em;}
  .boss-actions .adv-button {min-height:29px;font-size:.85rem;}
}
@media (prefers-reduced-motion:reduce) {
  .boss-hacked-projector,.boss-hacked-projector img,.boss-alert::before,.boss-celebration .gbl-speaker-name,
  .boss-arena-ui *,.boss-rewind-clock *,.boss-rewinding {animation:none!important;transition:none!important;}
  .boss-critical .boss-enemy {opacity:0;}
}

.gbl-boss-sheet .boss-result-title {margin:.1em 0 .35em;font:800 clamp(1.3rem,3vw,2.1rem)/1.05 var(--display);color:inherit;}
.boss-rewind-echoes {position:absolute;inset:0;pointer-events:none;}
.boss-rewind-echoes > div {position:absolute;inset:10% 20%;display:grid;place-items:center;opacity:0;animation:boss-rewind-echo .45s calc(var(--echo) * .4s) ease-out both;}
.boss-rewind-echoes img {height:75%;max-width:50%;object-fit:contain;filter:drop-shadow(0 0 20px #96f6ff);}
.boss-rewind-echoes b {color:#b5f8ff;font:800 2rem var(--display);}
@keyframes boss-rewind-echo {0%,100%{opacity:0;transform:scale(1.15);}40%{opacity:.23;transform:scale(.9);}}

.boss-alert .gbl-earth {animation:boss-earth-flicker .55s ease-out both;}
.boss-alert .boss-hacked-projector {animation-delay:.5s;}
.boss-hacked .gbl-projector-particles {filter:hue-rotate(150deg) saturate(2);}
@keyframes boss-earth-flicker {0%,30%,65%{visibility:visible;opacity:.8;}15%,50%{visibility:visible;opacity:.05;}to{visibility:hidden;opacity:0;}}
@media(prefers-reduced-motion:reduce){.boss-alert .gbl-earth,.boss-rewind-echoes>div{animation:none!important;}}

.boss-countdown.is-stopped{font-size:clamp(.85rem,1.5vw,1.15rem);color:#ddf5cf;border-color:#70ad84}
.boss-showing-feedback .boss-choices{display:none}
.boss-showing-feedback .boss-feedback{position:relative;inset:auto;overflow:visible;font-size:clamp(.88rem,1.15vw,1.05rem)}
.boss-feedback .boss-actions{justify-content:flex-end;margin:.45em 0 0;flex-shrink:0}
.boss-feedback .boss-actions .adv-button{min-height:38px;font-size:1rem}
.boss-correct-answer{color:#19575c}
