:root {
  color-scheme: dark;
  --void: #050506;
  --surface: #101014;
  --surface-raised: #17171c;
  --ink: #f5f2ed;
  --muted: #96959d;
  --dim: #5d5c65;
  --red: #ef2c25;
  --red-deep: #790805;
  --red-glow: rgba(239, 44, 37, 0.34);
  --amber: #f0b44d;
  --line: rgba(255, 255, 255, 0.12);
  --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --display-font: "Palatino Linotype", Palatino, Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  min-height: 100%;
  background: var(--void);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 44%, rgba(125, 16, 13, 0.19), transparent 24rem),
    radial-gradient(circle at 50% 120%, rgba(113, 118, 138, 0.08), transparent 38rem),
    var(--void);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}

button,
output {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.button-atmosphere::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 4rem 4rem;
  content: "";
  mask-image: radial-gradient(circle at 50% 48%, black, transparent 78%);
}

.button-atmosphere::after {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(255, 255, 255, 0.012) 3px 4px
  );
  content: "";
  opacity: 0.44;
}

.button-atmosphere span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(76vw, 48rem);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 48, 40, 0.07);
  transform: translate(-50%, -50%) rotate(45deg);
}

.button-atmosphere span:nth-child(2) {
  width: min(56vw, 35rem);
  border-color: rgba(255, 255, 255, 0.035);
}

.button-atmosphere span:nth-child(3) {
  width: min(36vw, 22rem);
  border-color: rgba(255, 48, 40, 0.1);
}

.button-stage {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: clamp(2rem, 5vh, 4rem) 1.25rem 4.75rem;
  transform-origin: center;
}

.button-console {
  display: grid;
  width: min(100%, 48rem);
  justify-items: center;
  text-align: center;
}

.button-kicker {
  margin: 0 0 0.7rem;
  color: var(--red);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(2.25rem, 8vw, 5.3rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 0 2.5rem rgba(255, 255, 255, 0.08);
}

.button-message {
  min-height: 1.7em;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(0.88rem, 2vw, 1rem);
  line-height: 1.6;
  text-wrap: balance;
}

.button-home {
  position: relative;
  display: grid;
  width: min(21rem, 78vw);
  min-height: clamp(14rem, 34vh, 19rem);
  margin-top: clamp(0.6rem, 2vh, 1.4rem);
  place-items: center;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.button-plinth {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(20rem, 76vw);
  height: 6.6rem;
  border: 1px solid rgba(219, 227, 234, 0.15);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, 0.13), transparent 48%),
    linear-gradient(#34343a, #0d0d10 72%);
  box-shadow:
    inset 0 1rem 1.2rem rgba(255, 255, 255, 0.035),
    0 2.2rem 3rem rgba(0, 0, 0, 0.7),
    0 0 0 1rem rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -32%);
}

.button-plinth::before {
  position: absolute;
  inset: 0.75rem 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.72);
  border-radius: inherit;
  box-shadow: inset 0 0.7rem 1rem rgba(0, 0, 0, 0.65);
  content: "";
}

.forbidden-button {
  position: relative;
  z-index: 2;
  display: grid;
  width: clamp(9.5rem, 25vw, 12.4rem);
  aspect-ratio: 1;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #8e0c08, #470403);
  box-shadow:
    0 0.7rem 0 #390504,
    0 1.2rem 1.4rem rgba(0, 0, 0, 0.7),
    0 0 3.2rem var(--red-glow);
  cursor: pointer;
  transition:
    filter 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.forbidden-button::before {
  position: absolute;
  inset: -0.7rem;
  z-index: -1;
  border: 1px solid rgba(239, 44, 37, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(239, 44, 37, 0.18);
  content: "";
  animation: warning-ring 2.8s ease-out infinite;
}

.forbidden-button__cap {
  display: grid;
  width: calc(100% - 0.8rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 198, 193, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 26%, rgba(255, 255, 255, 0.32), transparent 18%),
    radial-gradient(circle at 52% 48%, transparent 28%, rgba(82, 2, 0, 0.18) 70%),
    linear-gradient(145deg, #f43c33, #a20d09 61%, #610604);
  box-shadow:
    inset -1.1rem -1.2rem 2.1rem rgba(55, 1, 0, 0.62),
    inset 0.35rem 0.4rem 0.8rem rgba(255, 255, 255, 0.12);
}

.forbidden-button__label {
  max-width: 7rem;
  font-size: clamp(0.68rem, 1.8vw, 0.82rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}

.forbidden-button:hover {
  filter: brightness(1.08) saturate(1.08);
  transform: translateY(0.16rem);
}

.forbidden-button:active {
  box-shadow:
    0 0.32rem 0 #390504,
    0 0.7rem 1rem rgba(0, 0, 0, 0.72),
    0 0 2rem var(--red-glow);
  transform: translateY(0.46rem);
}

.forbidden-button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 0.55rem;
}

.forbidden-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.58);
}

body[data-mood="irritation"] .forbidden-button,
body[data-mood="negotiation"] .forbidden-button {
  --red-glow: rgba(255, 62, 25, 0.42);
}

body[data-mood="panic"] .forbidden-button,
body[data-mood="acceptance"] .forbidden-button {
  --red-glow: rgba(255, 36, 20, 0.58);
}

.button-readout {
  display: grid;
  min-width: min(19rem, 88vw);
  justify-items: center;
  gap: 0.28rem;
  margin-top: 0.45rem;
  padding: 0.8rem 1.4rem;
  border-top: 1px solid var(--line);
}

.button-readout__label {
  color: var(--dim);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.button-readout output {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.button-readout output[data-state="offline"] {
  color: var(--amber);
}

.button-reset-hint {
  margin: 0.75rem 0 0;
  color: var(--dim);
  font-size: 0.65rem;
}

.button-footer {
  position: fixed;
  right: 1.25rem;
  bottom: 1rem;
  left: 1.25rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--dim);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.button-footer a {
  color: inherit;
  text-decoration: none;
}

.button-footer a:hover {
  text-decoration: underline;
}

.button-footer a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.button-footer span[aria-hidden] {
  color: var(--red);
  font-size: 0.42rem;
}

.effect-layer,
.overlay-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

.overlay-layer {
  z-index: 50;
  display: grid;
  place-items: center;
}

.achievement-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 80;
  display: grid;
  width: min(22rem, calc(100vw - 2rem));
  gap: 0.65rem;
  pointer-events: none;
}

.achievement-toast {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(239, 44, 37, 0.38);
  background: rgba(12, 12, 15, 0.96);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.56);
  opacity: 0;
  transform: translateX(1.5rem);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.achievement-toast.is-visible {
  opacity: 1;
  transform: none;
}

.achievement-toast__seal {
  display: grid;
  width: 2rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(239, 44, 37, 0.5);
  color: var(--red);
  transform: rotate(45deg);
}

.achievement-toast__seal::first-letter {
  transform: rotate(-45deg);
}

.achievement-toast span:last-child {
  display: grid;
  gap: 0.13rem;
}

.achievement-toast b,
.achievement-toast strong,
.achievement-toast small {
  display: block;
}

.achievement-toast b {
  color: var(--red);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.achievement-toast strong {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 1.08rem;
  font-weight: 400;
}

.achievement-toast small {
  color: var(--muted);
  font-size: 0.7rem;
}

.button-home.is-relocated {
  transform: translate(var(--button-x), var(--button-y));
}

.button-position-0 {
  --button-x: -1.5rem;
  --button-y: -0.4rem;
}

.button-position-1 {
  --button-x: 1.5rem;
  --button-y: 0.35rem;
}

.button-position-2 {
  --button-x: -28vw;
  --button-y: -18vh;
}

.button-position-3 {
  --button-x: 29vw;
  --button-y: -16vh;
}

.button-position-4 {
  --button-x: -30vw;
  --button-y: 17vh;
}

.button-position-5 {
  --button-x: 28vw;
  --button-y: 16vh;
}

.button-position-6 {
  --button-x: -1rem;
  --button-y: 0.7rem;
}

.button-position-7 {
  --button-x: 1rem;
  --button-y: -0.65rem;
}

.button-position-8 {
  --button-x: -18vw;
  --button-y: 4vh;
}

.button-position-9 {
  --button-x: 19vw;
  --button-y: -3vh;
}

.button-position-10 {
  --button-x: -8vw;
  --button-y: -20vh;
}

.button-position-11 {
  --button-x: 9vw;
  --button-y: 19vh;
}

.forbidden-button.is-small {
  transform: scale(0.58);
}

.forbidden-button.is-large {
  transform: scale(1.26);
}

.forbidden-button.is-enormous {
  transform: scale(2.15);
}

.forbidden-button.is-missing {
  opacity: 0;
  transform: scale(0.15);
}

.confetti-piece {
  --confetti-x: 50vw;
  --confetti-delay: 0s;
  --confetti-drift: 4rem;
  --confetti-spin: 540deg;
  --confetti-color: #ef2c25;
  position: absolute;
  top: -1.5rem;
  left: var(--confetti-x);
  width: 0.6rem;
  height: 1.05rem;
  background: var(--confetti-color);
  animation: confetti-fall 3.7s var(--confetti-delay) cubic-bezier(0.24, 0.7, 0.42, 1) both;
}

.confetti-piece--0 {
  --confetti-x: 4vw;
  --confetti-delay: 0.05s;
  --confetti-drift: 6rem;
  --confetti-color: #ef2c25;
}

.confetti-piece--1 {
  --confetti-x: 13vw;
  --confetti-delay: 0.28s;
  --confetti-drift: -4rem;
  --confetti-color: #f0b44d;
}

.confetti-piece--2 {
  --confetti-x: 22vw;
  --confetti-delay: 0.12s;
  --confetti-drift: 8rem;
  --confetti-color: #e9e5df;
}

.confetti-piece--3 {
  --confetti-x: 31vw;
  --confetti-delay: 0.4s;
  --confetti-drift: -7rem;
  --confetti-color: #cb263c;
}

.confetti-piece--4 {
  --confetti-x: 41vw;
  --confetti-delay: 0.18s;
  --confetti-drift: 3rem;
  --confetti-color: #8d79d6;
}

.confetti-piece--5 {
  --confetti-x: 49vw;
  --confetti-delay: 0.02s;
  --confetti-drift: -5rem;
  --confetti-color: #ef2c25;
}

.confetti-piece--6 {
  --confetti-x: 58vw;
  --confetti-delay: 0.34s;
  --confetti-drift: 7rem;
  --confetti-color: #4eb3aa;
}

.confetti-piece--7 {
  --confetti-x: 66vw;
  --confetti-delay: 0.16s;
  --confetti-drift: -3rem;
  --confetti-color: #f0b44d;
}

.confetti-piece--8 {
  --confetti-x: 74vw;
  --confetti-delay: 0.44s;
  --confetti-drift: 5rem;
  --confetti-color: #e9e5df;
}

.confetti-piece--9 {
  --confetti-x: 82vw;
  --confetti-delay: 0.09s;
  --confetti-drift: -8rem;
  --confetti-color: #cb263c;
}

.confetti-piece--10 {
  --confetti-x: 90vw;
  --confetti-delay: 0.26s;
  --confetti-drift: 4rem;
  --confetti-color: #8d79d6;
}

.confetti-piece--11 {
  --confetti-x: 97vw;
  --confetti-delay: 0.38s;
  --confetti-drift: -6rem;
  --confetti-color: #4eb3aa;
}

.harmless-fire {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: min(30vh, 15rem);
  pointer-events: none;
  filter: drop-shadow(0 -0.35rem 0.7rem rgba(255, 75, 16, 0.32));
}

.harmless-fire::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: min(7vh, 4rem);
  background: linear-gradient(to top, rgba(255, 78, 12, 0.48), rgba(255, 135, 25, 0.16) 45%, transparent);
  content: "";
}

.harmless-fire i {
  position: absolute;
  bottom: -1.4rem;
  left: var(--flame-left, 50%);
  width: calc(var(--flame-width, 1) * clamp(3.5rem, 9vw, 8.5rem));
  height: calc(var(--flame-height, 1) * min(24vh, 11rem));
  background: linear-gradient(to top, #e93612 4%, #ff7517 44%, #ffae37 76%, #ffd17a);
  clip-path: polygon(0 100%, 7% 76%, 23% 62%, 25% 39%, 42% 53%, 58% 0, 66% 40%, 82% 59%, 92% 78%, 100% 100%);
  opacity: 0.82;
  transform: translateX(-50%) skewX(var(--flame-lean, 0deg));
  transform-origin: center bottom;
  animation: flame-dance var(--flame-duration, 1.2s) var(--flame-delay, 0s) ease-in-out infinite;
}

.harmless-fire i::after {
  position: absolute;
  bottom: 0;
  left: 24%;
  width: 52%;
  height: 68%;
  background: linear-gradient(to top, #ffad26, #ffe478 55%, #fff1b5);
  clip-path: polygon(0 100%, 8% 71%, 31% 55%, 39% 20%, 60% 43%, 73% 0, 81% 63%, 100% 100%);
  content: "";
}

.harmless-fire i:nth-child(3n + 2) {
  clip-path: polygon(0 100%, 9% 73%, 24% 57%, 40% 0, 48% 41%, 65% 62%, 79% 35%, 84% 68%, 100% 100%);
}

.harmless-fire i:nth-child(3n) {
  clip-path: polygon(0 100%, 12% 67%, 29% 39%, 41% 56%, 61% 0, 68% 38%, 87% 68%, 100% 100%);
}

.harmless-fire .flame-0 {
  --flame-left: 2%;
  --flame-width: 1.07;
  --flame-height: 0.82;
  --flame-lean: -4deg;
  --flame-delay: -0.2s;
  --flame-duration: 1.2s;
}

.harmless-fire .flame-1 {
  --flame-left: 10%;
  --flame-width: 0.74;
  --flame-height: 1.07;
  --flame-lean: 5deg;
  --flame-delay: -0.85s;
  --flame-duration: 0.96s;
}

.harmless-fire .flame-2 {
  --flame-left: 18%;
  --flame-width: 1.15;
  --flame-height: 0.69;
  --flame-lean: -6deg;
  --flame-delay: -0.45s;
  --flame-duration: 1.36s;
}

.harmless-fire .flame-3 {
  --flame-left: 26%;
  --flame-width: 0.83;
  --flame-height: 1.24;
  --flame-lean: 4deg;
  --flame-delay: -1.1s;
  --flame-duration: 1.08s;
}

.harmless-fire .flame-4 {
  --flame-left: 35%;
  --flame-width: 1.08;
  --flame-height: 0.93;
  --flame-lean: -3deg;
  --flame-delay: -0.35s;
  --flame-duration: 1.48s;
}

.harmless-fire .flame-5 {
  --flame-left: 44%;
  --flame-width: 0.92;
  --flame-height: 0.74;
  --flame-lean: 7deg;
  --flame-delay: -0.7s;
  --flame-duration: 1.15s;
}

.harmless-fire .flame-6 {
  --flame-left: 54%;
  --flame-width: 0.78;
  --flame-height: 1.1;
  --flame-lean: -5deg;
  --flame-delay: -0.95s;
  --flame-duration: 0.92s;
}

.harmless-fire .flame-7 {
  --flame-left: 63%;
  --flame-width: 1.18;
  --flame-height: 0.84;
  --flame-lean: 3deg;
  --flame-delay: -0.1s;
  --flame-duration: 1.28s;
}

.harmless-fire .flame-8 {
  --flame-left: 71%;
  --flame-width: 0.87;
  --flame-height: 1.2;
  --flame-lean: -7deg;
  --flame-delay: -0.6s;
  --flame-duration: 1.04s;
}

.harmless-fire .flame-9 {
  --flame-left: 81%;
  --flame-width: 1.03;
  --flame-height: 0.72;
  --flame-lean: 5deg;
  --flame-delay: -1.3s;
  --flame-duration: 1.4s;
}

.harmless-fire .flame-10 {
  --flame-left: 90%;
  --flame-width: 0.8;
  --flame-height: 1.01;
  --flame-lean: -4deg;
  --flame-delay: -0.4s;
  --flame-duration: 1.18s;
}

.harmless-fire .flame-11 {
  --flame-left: 98%;
  --flame-width: 1.12;
  --flame-height: 0.88;
  --flame-lean: 6deg;
  --flame-delay: -0.75s;
  --flame-duration: 1.32s;
}

.fake-dialog {
  width: min(31rem, calc(100vw - 2rem));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.45rem;
  color: #1b1b1f;
  background: #f1f1f1;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.78);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(1rem) scale(0.96);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.fake-dialog.is-visible {
  opacity: 1;
  transform: none;
}

.fake-dialog header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  color: #fff;
  background: #174a8b;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.8rem;
}

.fake-dialog header b {
  flex: 1;
}

.fake-dialog button {
  border: 1px solid #9b9b9b;
  border-radius: 0.15rem;
  color: #1b1b1f;
  background: #fff;
  cursor: pointer;
}

.fake-dialog header button {
  width: 1.7rem;
  height: 1.4rem;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 1.15rem;
}

.fake-dialog > div {
  padding: 1.4rem;
  font-family: "Segoe UI", sans-serif;
}

.fake-dialog > div strong,
.fake-dialog > div p {
  display: block;
  margin: 0;
}

.fake-dialog > div p {
  margin-top: 0.55rem;
  color: #4f4f55;
  font-size: 0.8rem;
}

.fake-dialog footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.4rem 1.1rem;
}

.fake-dialog footer button {
  padding: 0.45rem 0.8rem;
}

.fake-dialog--error header {
  background: #a20d09;
}

.fake-dialog--maintenance header {
  background: #58545e;
}

.fake-dialog--milestone,
.fake-dialog--cosmic {
  color: var(--ink);
  background: #0e0e13;
}

.fake-dialog--milestone header,
.fake-dialog--cosmic header {
  background: linear-gradient(90deg, #8f0b07, #4a123f);
}

.fake-dialog--milestone > div p,
.fake-dialog--cosmic > div p {
  color: var(--muted);
}

.countdown-panel,
.useless-progress,
.terminal-takeover,
.diagnostic-panel,
.boss-panel,
.reboot-panel {
  width: min(34rem, calc(100vw - 2rem));
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ink);
  background: rgba(8, 8, 11, 0.96);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.74);
}

.countdown-panel {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
}

.countdown-panel span,
.useless-progress span,
.boss-panel span {
  color: var(--red);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.countdown-panel strong {
  font-family: var(--display-font);
  font-size: clamp(3rem, 15vw, 7rem);
  font-weight: 400;
  line-height: 1;
}

.countdown-panel.is-complete strong {
  font-size: clamp(1.7rem, 7vw, 3.2rem);
}

.useless-progress,
.boss-panel,
.reboot-panel {
  display: grid;
  gap: 0.85rem;
}

.useless-progress i,
.boss-panel i,
.reboot-panel i {
  height: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050506;
}

.useless-progress i b,
.boss-panel i b,
.reboot-panel i::before {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, #8f0b07, var(--red));
  content: "";
  animation: useless-progress 3.8s ease-in-out infinite alternate;
}

.useless-progress small,
.boss-panel small {
  color: var(--muted);
  font-size: 0.7rem;
}

.terminal-takeover {
  color: #79ff9b;
  border-color: rgba(121, 255, 155, 0.28);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(0.68rem, 2vw, 0.86rem);
}

.terminal-takeover span {
  color: rgba(121, 255, 155, 0.56);
}

.terminal-takeover p {
  margin: 0.65rem 0 0;
}

.terminal-cursor {
  animation: cursor-blink 0.7s steps(2, end) infinite;
}

.diagnostic-panel {
  display: grid;
  gap: 0.75rem;
}

.diagnostic-panel b {
  font-family: var(--display-font);
  font-size: 1.4rem;
  font-weight: 400;
}

.diagnostic-panel span {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.diagnostic-panel i {
  color: var(--red);
  font-style: normal;
}

.boss-panel i b {
  width: 100%;
  animation: boss-health 5s ease-in-out both;
}

.reboot-panel {
  justify-items: center;
  text-align: center;
}

.reboot-panel strong {
  font-family: var(--display-font);
  font-size: 2rem;
  font-weight: 400;
}

.reboot-panel span {
  color: var(--muted);
  font-size: 0.78rem;
}

.reboot-panel i {
  width: min(18rem, 80%);
}

.forbidden-button--duplicate {
  position: fixed;
  top: var(--clone-top);
  left: var(--clone-left);
  z-index: 3;
  width: clamp(4.7rem, 10vw, 6.5rem);
  pointer-events: auto;
  transform: rotate(var(--clone-rotation));
  animation: clone-arrive 380ms ease-out both;
}

.forbidden-button--duplicate .forbidden-button__label {
  max-width: 4rem;
  font-size: 0.48rem;
}

.clone-position-0 {
  --clone-top: 12%;
  --clone-left: 8%;
  --clone-rotation: -9deg;
}

.clone-position-1 {
  --clone-top: 17%;
  --clone-left: 76%;
  --clone-rotation: 7deg;
}

.clone-position-2 {
  --clone-top: 67%;
  --clone-left: 13%;
  --clone-rotation: 5deg;
}

.clone-position-3 {
  --clone-top: 72%;
  --clone-left: 79%;
  --clone-rotation: -6deg;
}

.clone-position-4 {
  --clone-top: 41%;
  --clone-left: 4%;
  --clone-rotation: 11deg;
}

.clone-position-5 {
  --clone-top: 43%;
  --clone-left: 86%;
  --clone-rotation: -12deg;
}

.clone-position-6 {
  --clone-top: 7%;
  --clone-left: 45%;
  --clone-rotation: 4deg;
}

.clone-position-7 {
  --clone-top: 82%;
  --clone-left: 45%;
  --clone-rotation: -4deg;
}

body.is-shaking .button-stage {
  animation: screen-shake 620ms linear both;
}

body.is-shaking-heavy .button-stage {
  animation: screen-shake-heavy 1s linear both;
}

body.is-tilted .button-stage {
  transform: rotate(-2.3deg) scale(0.98);
}

body.is-rotating .button-stage {
  animation: room-rotate 4.8s cubic-bezier(0.48, 0.02, 0.2, 1) both;
}

body.is-inverted .button-stage,
body.is-inverted .button-atmosphere {
  filter: invert(1) hue-rotate(180deg);
}

body.is-monochrome .button-stage,
body.is-monochrome .button-atmosphere {
  filter: grayscale(1);
}

body.is-saturated .button-stage,
body.is-saturated .button-atmosphere {
  filter: saturate(4.5) contrast(1.18);
}

body.is-blackout .button-stage {
  opacity: 0.12;
}

body.is-blackout .forbidden-button {
  opacity: 1;
  filter: brightness(1.5);
}

body.is-red-alert::before,
body.is-cosmic::before,
body.is-milestone::before {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  content: "";
}

body.is-red-alert::before {
  background: radial-gradient(circle, transparent 25%, rgba(182, 0, 0, 0.4));
  animation: red-alert 0.9s ease-in-out infinite alternate;
}

body.is-pixelated .button-stage {
  filter: contrast(1.3);
  font-family: ui-monospace, Consolas, monospace;
  image-rendering: pixelated;
}

body.is-gravity-failed .button-console {
  animation: gravity-failure 3.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.is-rebooting .button-stage {
  opacity: 0.15;
}

body.is-cosmic::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(111, 79, 224, 0.28), transparent 28%),
    radial-gradient(circle at 75% 65%, rgba(219, 50, 76, 0.28), transparent 30%);
  animation: cosmic-bloom 5s ease-in-out both;
}

body.is-milestone::before {
  border: 0.5rem solid rgba(239, 44, 37, 0.7);
  box-shadow: inset 0 0 6rem rgba(239, 44, 37, 0.22);
  animation: milestone-pulse 1.3s ease-in-out 3;
}

@keyframes warning-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 44, 37, 0.24);
  }
  72%,
  100% {
    box-shadow: 0 0 0 1.25rem rgba(239, 44, 37, 0);
  }
}

@keyframes confetti-fall {
  from {
    opacity: 1;
    transform: translate3d(0, -2rem, 0) rotate(0);
  }
  to {
    opacity: 0.75;
    transform: translate3d(var(--confetti-drift), 108vh, 0) rotate(640deg);
  }
}

@keyframes flame-dance {
  0%, 100% {
    opacity: 0.72;
    transform: translateX(-50%) skewX(var(--flame-lean, 0deg)) scaleY(0.95);
  }
  35% {
    opacity: 0.9;
    transform: translateX(-50%) translateY(-0.35rem) skewX(var(--flame-lean, 0deg)) scaleY(1.04);
  }
  70% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(-0.1rem) skewX(var(--flame-lean, 0deg)) scaleY(0.98);
  }
}

@keyframes useless-progress {
  from {
    width: 7%;
  }
  to {
    width: 91%;
  }
}

@keyframes cursor-blink {
  50% {
    opacity: 0.3;
  }
}

@keyframes boss-health {
  0%,
  78% {
    width: 100%;
  }
  88% {
    width: 4%;
  }
  100% {
    width: 100%;
  }
}

@keyframes clone-arrive {
  from {
    opacity: 0;
    transform: scale(0.2) rotate(var(--clone-rotation));
  }
}

@keyframes screen-shake {
  20% {
    transform: translate(-0.4rem, 0.18rem);
  }
  40% {
    transform: translate(0.35rem, -0.2rem);
  }
  60% {
    transform: translate(-0.22rem, -0.12rem);
  }
  80% {
    transform: translate(0.18rem, 0.2rem);
  }
}

@keyframes screen-shake-heavy {
  20% {
    transform: translate(-0.8rem, 0.35rem) rotate(-0.5deg);
  }
  40% {
    transform: translate(0.7rem, -0.4rem) rotate(0.5deg);
  }
  60% {
    transform: translate(-0.5rem, -0.25rem) rotate(-0.3deg);
  }
  80% {
    transform: translate(0.4rem, 0.35rem) rotate(0.3deg);
  }
}

@keyframes room-rotate {
  0%,
  100% {
    transform: rotate(0) scale(1);
  }
  45%,
  60% {
    transform: rotate(180deg) scale(0.72);
  }
}

@keyframes red-alert {
  to {
    background-color: rgba(255, 0, 0, 0.12);
  }
}

@keyframes gravity-failure {
  0%,
  100% {
    transform: none;
  }
  35% {
    transform: translateY(-22vh) rotate(5deg);
  }
  75% {
    transform: translateY(20vh) rotate(-3deg);
  }
}

@keyframes cosmic-bloom {
  0% {
    opacity: 0;
    filter: hue-rotate(0deg);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    filter: hue-rotate(180deg);
  }
}

@keyframes milestone-pulse {
  50% {
    border-color: rgba(255, 226, 166, 0.9);
    box-shadow: inset 0 0 9rem rgba(239, 44, 37, 0.38);
  }
}

@media (max-width: 42rem) {
  .button-stage {
    padding-top: 1.4rem;
    padding-bottom: 5.5rem;
  }

  .button-home {
    min-height: 13rem;
  }

  .button-plinth {
    height: 5.3rem;
  }

  .forbidden-button {
    width: clamp(8.7rem, 38vw, 10.4rem);
  }

  .button-position-2,
  .button-position-4,
  .button-position-8 {
    --button-x: -18vw;
  }

  .button-position-3,
  .button-position-5,
  .button-position-9 {
    --button-x: 18vw;
  }

  .button-position-10 {
    --button-y: -13vh;
  }

  .button-position-11 {
    --button-y: 12vh;
  }

  .forbidden-button--duplicate {
    width: 4.7rem;
  }

  .clone-position-1,
  .clone-position-3 {
    --clone-left: 72%;
  }

  .clone-position-5 {
    --clone-left: 74%;
  }

  .button-footer {
    flex-wrap: wrap;
    row-gap: 0.3rem;
  }
}

@media (max-height: 42rem) and (min-width: 43rem) {
  .button-stage {
    padding-block: 1.2rem 3.5rem;
  }

  h1 {
    font-size: clamp(2rem, 8vh, 3.8rem);
  }

  .button-home {
    min-height: 11rem;
    margin-top: 0;
  }

  .forbidden-button {
    width: clamp(7rem, 22vh, 9rem);
  }

  .button-plinth {
    width: 15rem;
    height: 4.5rem;
  }

  .button-reset-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .confetti-piece {
    top: 12%;
    opacity: 0.8;
  }

  .harmless-fire i {
    animation: none;
    opacity: 0.68;
    transform: translateX(-50%) skewX(var(--flame-lean, 0deg));
  }

  body.is-rotating .button-stage {
    transform: rotate(2deg) scale(0.98);
  }

  body.is-gravity-failed .button-console {
    transform: translateY(0.7rem);
  }
}
