body[data-phase="disconnected"] .grid,
body[data-phase="disconnected"] .task-inline,
body[data-phase="disconnected"] .shape-task,
body[data-phase="disconnected"] .memory-task,
body[data-phase="disconnected"] .drag-task,
body[data-phase="disconnected"] .timer-dots,
body[data-phase="disconnected"] .success-indicator,
body[data-phase="disconnected"] .result-flash,
body[data-phase="disconnected"] .slot,
body[data-phase="disconnected"] .placeholder {
  opacity: 0;
}

.grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 6px;
  place-content: center;
  padding-top: var(--task-label-clearance, 0px);
  padding-bottom: var(--task-footer-clearance, 0px);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease;
}

.grid.active {
  opacity: 1;
  pointer-events: auto;
}

.shape-task {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: var(--task-label-clearance, 0px);
  padding-bottom: var(--task-footer-clearance, 0px);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease;
  --shape-size: clamp(64px, 8vmin, 100px);
  --shape-gap: clamp(12px, 2.4vmin, 20px);
}

.shape-task.active {
  opacity: 1;
}

.memory-task {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: var(--task-label-clearance, 0px);
  padding-bottom: var(--task-footer-clearance, 0px);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease;
  cursor: var(--player-cursor), pointer;
}

.memory-task.active {
  opacity: 1;
}

.memory-task.color-word-active {
  pointer-events: auto;
}

.memory-task.square-tiles-active {
  pointer-events: auto;
}

.drag-task {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--task-label-clearance, 0px);
  padding-bottom: var(--task-footer-clearance, 0px);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.2s ease;
  touch-action: none;
}

.drag-task.active {
  opacity: 1;
  pointer-events: auto;
}

.drag-task.readonly {
  pointer-events: none;
}

.drag-task__stage {
  position: relative;
  width: min(88%, 260px);
  aspect-ratio: 2 / 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
  touch-action: none;
}

.drag-task__stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 1px;
  background: rgba(var(--accent-rgb), 0.6);
}

.drag-task__arena {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.2);
  --corner-gap: 22%;
  --corner-stub: clamp(4px, 4%, 10px);
  --arena-line: 2px;
  background: transparent;
  touch-action: none;
}

.drag-task__frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.drag-task__frame-line {
  position: absolute;
  background: rgba(var(--accent-rgb), 0.6);
}

.drag-task__frame-line--top {
  top: var(--corner-stub);
  left: var(--corner-gap);
  right: 0;
  height: var(--arena-line);
}

.drag-task__frame-line--left {
  top: 0;
  bottom: var(--corner-stub);
  left: 0;
  width: var(--arena-line);
}

.drag-task__frame-line--bottom {
  bottom: var(--corner-stub);
  left: 0;
  right: var(--corner-gap);
  height: var(--arena-line);
}

.drag-task__frame-line--right {
  top: var(--corner-stub);
  bottom: 0;
  right: 0;
  width: var(--arena-line);
}

.drag-task__frame-stub {
  position: absolute;
  background: rgba(var(--accent-rgb), 0.6);
}

.drag-task__frame-stub--top-left-vert {
  top: 0;
  left: var(--corner-gap);
  width: var(--arena-line);
  height: var(--corner-stub);
}

.drag-task__frame-stub--bottom-right-vert {
  bottom: 0;
  right: var(--corner-gap);
  width: var(--arena-line);
  height: var(--corner-stub);
}

.drag-task__block-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.drag-task__goal {
  position: absolute;
  border-radius: 999px;
  border: 1px dashed rgba(120, 190, 255, 0.55);
  opacity: 0.5;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  pointer-events: none;
  display: none;
}

.drag-task__ball {
  position: absolute;
  border-radius: 50%;
  background: var(--drag-circle-color, #4b84ff);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.7);
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: var(--player-cursor), pointer;
  z-index: 3;
}

.drag-task__ball.dragging {
  background: #f7f7f7;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.85);
}

.drag-task__block {
  position: absolute;
  border-radius: 0;
  height: 15px;
  background: linear-gradient(90deg, #ffb24a, #ff3a3a);
  box-shadow:
    0 0 10px rgba(255, 120, 70, 0.85),
    0 0 22px rgba(255, 90, 40, 0.6),
    0 0 36px rgba(255, 70, 35, 0.5);
  filter: drop-shadow(0 0 8px rgba(255, 140, 80, 0.7));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.drag-task--fail .drag-task__ball {
  box-shadow: 0 0 16px rgba(255, 90, 40, 0.8);
}

.drag-task--success .drag-task__ball {
  box-shadow: 0 0 18px rgba(120, 255, 170, 0.8);
}

.square-tiles {
  position: relative;
  width: 160px;
  height: 160px;
  --triangle-base: 80px;
  --triangle-height: 40px;
  --pivot-offset: 40px;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.square-tiles__tile {
  position: absolute;
  width: var(--triangle-base);
  height: var(--triangle-height);
  left: 50%;
  top: 50%;
  transform: translate(-50%, 0) translate(var(--pivot-x, 0px), var(--pivot-y, 0px));
  border: none;
  padding: 0;
  background: transparent;
  display: block;
  cursor: var(--player-cursor), pointer;
  pointer-events: none;
  outline: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.square-tiles__tile:focus,
.square-tiles__tile:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.square-tiles__tile:disabled {
  cursor: var(--player-cursor), pointer;
  opacity: 1;
}

.square-tiles__triangle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--square-color);
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  cursor: var(--player-cursor), pointer;
  pointer-events: auto;
  transform: translateZ(0)
    rotate(calc(var(--base-rotation, 0deg) + var(--square-rotation, 0deg)));
  transform-origin: 50% 0%;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.4));
  backface-visibility: hidden;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.square-tiles[data-active="false"] .square-tiles__triangle {
  transition: none;
}

.square-tiles__tile.remote-click .square-tiles__triangle {
  animation: trianglePulse 0.5s steps(2) 1;
}

.square-tiles__tile[data-index="0"] {
  --base-rotation: 0deg;
  --pivot-x: 0px;
  --pivot-y: calc(-1 * var(--pivot-offset));
}

.square-tiles__tile[data-index="1"] {
  --base-rotation: 90deg;
  --pivot-x: var(--pivot-offset);
  --pivot-y: 0px;
}

.square-tiles__tile[data-index="2"] {
  --base-rotation: 180deg;
  --pivot-x: 0px;
  --pivot-y: var(--pivot-offset);
}

.square-tiles__tile[data-index="3"] {
  --base-rotation: 270deg;
  --pivot-x: calc(-1 * var(--pivot-offset));
  --pivot-y: 0px;
}

.color-word-task {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  cursor: var(--player-cursor), pointer;
}

.color-word-task__button {
  border: none;
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: var(--player-cursor), pointer;
}

.color-word-task__button:disabled {
  cursor: var(--player-cursor), pointer;
  opacity: 1;
}

.color-word-task__circle {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
  cursor: inherit;
}

.color-word-task__circle.remote-click::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  animation: remoteClickPulse 0.6s ease-out;
}

.color-word-task__label {
  font-size: 26px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  cursor: inherit;
}

.color-word-task.glitch .color-word-task__circle,
.color-word-task.glitch .color-word-task__label {
  animation: introGlitchOut 0.55s steps(2) 1;
  filter: blur(0.4px);
}

.memory-task__pairs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 240px;
}

.memory-task__shuffle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.memory-task__prompt {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.memory-task__options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  pointer-events: auto;
  width: 100%;
}

.memory-task__option {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--player-cursor), pointer;
}

.memory-task__option:disabled {
  cursor: var(--player-cursor), pointer;
  opacity: 1;
}

.memory-task__option.remote-click::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  animation: remoteClickPulse 0.6s ease-out;
}

.memory-task__dot {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "OmbudsmanStencil", "Menlo", "Courier New", monospace;
  font-size: 18px;
  color: #f7f7f7;
  z-index: 0;
}

.memory-task__dot--neutral {
  color: #1b2231;
  background: linear-gradient(135deg, #f7f7f7, #bfc7d6);
}

.memory-task__dot--shuffle {
  animation: memoryShufflePulse 0.14s steps(2) infinite;
}

.memory-task__dot--pair {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

.memory-task__dot--large {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.memory-task__number {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2ch;
  line-height: 1;
  font-size: 26pt;
  text-align: center;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  transform: translate(-50%, -50%);
}

@keyframes memoryShufflePulse {
  0% {
    transform: scale(1);
    filter: blur(0);
  }
  50% {
    transform: scale(0.88);
    filter: blur(1px);
  }
  100% {
    transform: scale(1);
    filter: blur(0);
  }
}

.shape-task__shapes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--shape-gap);
  justify-items: center;
  align-items: center;
  max-width: calc(var(--shape-size) * 2 + var(--shape-gap));
}

.shape-task.question .shape-task__shapes {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  grid-template-columns: 1fr;
  max-width: none;
}

.shape-task__shape {
  width: var(--shape-size);
  height: var(--shape-size);
  color: inherit;
}

.task-stagger {
  opacity: 0;
  transform: scale(0.9);
  filter: blur(2px);
  --stagger-delay: 0ms;
  --stagger-out-delay: 0ms;
  animation: taskStaggerIn 0.35s steps(2) forwards;
  animation-delay: var(--stagger-delay);
}

.task-stagger-fade {
  opacity: 0;
  filter: blur(2px);
  --stagger-delay: 0ms;
  --stagger-out-delay: 0ms;
  animation: taskStaggerFadeIn 0.3s steps(2) forwards;
  animation-delay: var(--stagger-delay);
}

.quadrant.task-exit .task-stagger {
  animation: taskStaggerOut 0.25s steps(2) forwards;
  animation-delay: var(--stagger-out-delay);
}

.quadrant.task-exit .task-stagger-fade {
  animation: taskStaggerFadeOut 0.2s steps(2) forwards;
  animation-delay: var(--stagger-out-delay);
}

.shape-task__options {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  pointer-events: auto;
  width: 100%;
}

.shape-task__option {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: var(--player-cursor), pointer;
}

.shape-task__option:disabled {
  cursor: var(--player-cursor), pointer;
  opacity: 1;
}

.shape-task__option.remote-click::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  animation: remoteClickPulse 0.6s ease-out;
}

.shape-task__dot {
  width: 100%;
  height: 100%;
  display: block;
}

.cell {
  background: transparent;
  border: none;
  color: #f7f7f7;
  font-size: 20px;
  font-weight: 600;
  font-family: "OmbudsmanStencil", "Menlo", "Courier New", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  cursor: var(--player-cursor), pointer;
  position: relative;
}

.cell.find-target {
  font-size: 46px;
  letter-spacing: -0.08em;
}

.cell:disabled {
  opacity: 1;
  cursor: var(--player-cursor), pointer;
}

.cell::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 8px;
  border: 1px solid transparent;
  opacity: 0;
  pointer-events: none;
}

.cell-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
  color: currentColor;
  line-height: 1;
}

.cell.correct {
  color: var(--success-green);
}

.cell.incorrect {
  color: #ff5a5a;
}

.cell.crt-hit .cell-value {
  text-shadow: 0 0 6px rgba(75, 255, 122, 0.45), 0 0 12px rgba(75, 255, 122, 0.25);
  animation: crtCellPulse 0.05s linear 1;
}

.cell.incorrect .cell-value {
  text-shadow: 0 0 6px rgba(255, 90, 90, 0.5), 0 0 12px rgba(255, 90, 90, 0.35);
  animation: missPulse 0.2s ease-out 1;
}

.cell.click-pulse::after {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: clickPulse 0.4s ease-out;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #515a6d;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  z-index: 3;
}

.timer-dots {
  position: absolute;
  display: flex;
  gap: 6px;
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, var(--timer-offset-y, 0));
  --glitch-base-x: -50%;
  --glitch-base-y: var(--timer-offset-y, 0px);
  transition: opacity 0.2s ease;
}

.timer-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
}

.timer-dots .dot.filled {
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.timer-dots.danger .dot.filled {
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.7),
    0 0 16px rgba(var(--accent-rgb), 0.85);
}

.timer-dots .dot.gain {
  animation: dotGain 0.35s steps(2) 1;
}

.task {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #cdd5e5;
  position: relative;
  padding-bottom: 10px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.task-inline {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  color: #f7f7f7;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: var(--task-font-size, 16px);
  line-height: 1.1;
  max-width: 85%;
  text-align: center;
  white-space: nowrap;
}

.task-inline.task-hidden {
  display: none;
}

.task-inline[data-task-id="find_sixes"],
.task-inline[data-task-id="find_nines"] {
  font-size: var(--task-font-size, 22px);
}

.task-inline.task-inline--wrap {
  white-space: normal;
}

.task-inline[data-task-id="color_word"],
.task-inline[data-task-id="color_word"].task-inline--wrap {
  white-space: pre-line;
  font-size: calc(var(--task-font-size, 16px) * 0.85);
}

.task::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
}

.mini-map {
  display: flex;
  align-items: center;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0;
  width: 150px;
  height: 150px;
  position: relative;
  --mini-divider-gap: 6px;
  --mini-divider-color: rgba(255, 255, 255, 0.2);
}

.mini-quadrant {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  overflow: hidden;
  z-index: 1;
}

.mini-quadrant::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  opacity: 0;
  transform: scale(0.96);
  transform-origin: center;
  pointer-events: none;
}

.mini-quadrant.empty {
  color: #8a93a3;
  --accent: #8a93a3;
  --accent-rgb: 138, 147, 163;
  --accent-light: #c1c7d4;
  --accent-dark: #8a93a3;
}

.mini-quadrant.empty .mini-level {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.mini-quadrant.pulse-danger {
  --pulse-color: 255, 196, 90;
}

.mini-quadrant.pulse-fail {
  --pulse-color: 255, 92, 92;
}

.mini-quadrant.pulse-danger::before,
.mini-quadrant.pulse-fail::before {
  opacity: 1;
  border-color: rgba(var(--pulse-color), 0.65);
  box-shadow: 0 0 10px rgba(var(--pulse-color), 0.4);
  animation: miniPulse 1.1s ease-out infinite;
}

.mini-grid::before,
.mini-grid::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.mini-grid::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-0.5px);
  background: linear-gradient(
    to bottom,
    var(--mini-divider-color) 0%,
    var(--mini-divider-color) calc(50% - var(--mini-divider-gap)),
    transparent calc(50% - var(--mini-divider-gap)),
    transparent calc(50% + var(--mini-divider-gap)),
    var(--mini-divider-color) calc(50% + var(--mini-divider-gap)),
    var(--mini-divider-color) 100%
  );
}

.mini-grid::after {
  left: 0;
  right: 0;
  top: calc(50% + 3px);
  height: 1px;
  transform: translateY(-0.5px);
  background: linear-gradient(
    to right,
    var(--mini-divider-color) 0%,
    var(--mini-divider-color) calc(50% - var(--mini-divider-gap)),
    transparent calc(50% - var(--mini-divider-gap)),
    transparent calc(50% + var(--mini-divider-gap)),
    var(--mini-divider-color) calc(50% + var(--mini-divider-gap)),
    var(--mini-divider-color) 100%
  );
}

.mini-quadrant.out {
  opacity: 0.45;
}

.mini-level {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  opacity: 0.7;
  pointer-events: none;
  background: rgba(var(--accent-rgb), 0.12);
  --mini-glyph: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 8px;
  line-height: 1.2;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  color: var(--mini-glyph);
}

.mini-level--idle {
  border-style: dashed;
  opacity: 0.4;
}

.mini-level__grid,
.mini-level__dot,
.mini-level__bar,
.mini-level__tile,
.mini-level__diamond {
  display: none;
  position: absolute;
}

.mini-level__text {
  display: block;
  width: 100%;
}

.mini-level__grid {
  top: 20%;
  left: 20%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mini-glyph);
  box-shadow:
    0 10px 0 0 var(--mini-glyph),
    0 20px 0 0 var(--mini-glyph),
    10px 0 0 0 var(--mini-glyph),
    10px 10px 0 0 var(--mini-glyph),
    10px 20px 0 0 var(--mini-glyph),
    20px 0 0 0 var(--mini-glyph),
    20px 10px 0 0 var(--mini-glyph),
    20px 20px 0 0 var(--mini-glyph);
}

.mini-level__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--mini-glyph);
  top: 26%;
  left: 26%;
}

.mini-level__dot--alt {
  top: auto;
  left: auto;
  bottom: 26%;
  right: 26%;
}

.mini-level__bar {
  width: 60%;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
  top: 50%;
  left: 20%;
}

.mini-level__tile {
  width: 28%;
  height: 28%;
  border: 1px solid var(--mini-glyph);
  top: 24%;
  left: 24%;
}

.mini-level__tile--alt {
  width: 18%;
  height: 18%;
  top: auto;
  left: auto;
  bottom: 24%;
  right: 24%;
  border-color: rgba(255, 255, 255, 0.55);
}

.mini-level__diamond {
  width: 26%;
  height: 26%;
  border: 1px solid var(--mini-glyph);
  top: 32%;
  left: 37%;
  transform: rotate(45deg);
}

.mini-level--drag_circles .mini-level__dot,
.mini-level--drag_circles .mini-level__dot--alt,
.mini-level--drag_circles .mini-level__bar {
  display: block;
}

.mini-level--color_word .mini-level__dot,
.mini-level--color_word .mini-level__bar {
  display: block;
}

.mini-level--square_tiles .mini-level__tile,
.mini-level--square_tiles .mini-level__tile--alt {
  display: block;
}

.mini-level--number_grid .mini-level__grid {
  display: block;
}

.mini-level--memory .mini-level__diamond,
.mini-level--memory .mini-level__dot {
  display: block;
}

.mini-slot {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f7f7f7;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.mini-slot.empty {
  color: #6c7382;
}

.mini-chevron {
  position: absolute;
  width: 16px;
  height: 16px;
  color: var(--accent-light);
  opacity: 0.9;
  z-index: 2;
  pointer-events: none;
}

.mini-chevron svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-chevron--right {
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.mini-chevron--left {
  left: 6px;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
}

.mini-chevron--up {
  top: 6px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
}

.mini-chevron--down {
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
}

.mini-health {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 8%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.mini-health__fill {
  display: block;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.95),
    rgba(var(--accent-rgb), 0.55)
  );
}

.mini-map .result-flash {
  filter: blur(2px);
}

.mini-quadrant.glitch {
  animation: introGlitchOut 0.55s steps(2) 1;
  filter: blur(0.4px);
}

body[data-phase="lobby"] .grid,
body[data-phase="countdown"] .grid {
  visibility: hidden;
}

body[data-phase="lobby"] .shape-task,
body[data-phase="countdown"] .shape-task,
body[data-phase="lobby"] .memory-task,
body[data-phase="countdown"] .memory-task,
body[data-phase="lobby"] .drag-task,
body[data-phase="countdown"] .drag-task {
  opacity: 0;
  pointer-events: none;
}

body[data-super="1"] {
  --super-divider-delay: 0.9s;
  --super-stage-delay: 1.25s;
}

body[data-super="1"] .quadrant[data-color="yellow"] {
  --super-exit-delay: 0s;
}

body[data-super="1"] .quadrant[data-color="blue"] {
  --super-exit-delay: 0.12s;
}

body[data-super="1"] .quadrant[data-color="red"] {
  --super-exit-delay: 0.24s;
}

body[data-super="1"] .quadrant[data-color="green"] {
  --super-exit-delay: 0.36s;
}

body[data-super="1"] .quadrant .grid,
body[data-super="1"] .quadrant .shape-task,
body[data-super="1"] .quadrant .memory-task,
body[data-super="1"] .quadrant .drag-task,
body[data-super="1"] .quadrant .task-inline,
body[data-super="1"] .quadrant .timer-dots,
body[data-super="1"] .quadrant .slot,
body[data-super="1"] .quadrant .placeholder,
body[data-super="1"] .quadrant .result-flash {
  animation: taskVanishGrid 0.45s steps(2) 1 forwards;
  animation-delay: var(--super-exit-delay, 0s);
  pointer-events: none;
}

body[data-super="1"] .quadrant .task-inline {
  animation: taskVanishLabel 0.45s steps(2) 1 forwards;
  animation-delay: var(--super-exit-delay, 0s);
}

body[data-super="1"] .quadrant.urgent::before {
  opacity: 0;
  animation: none;
}

body[data-results="1"] {
  --results-divider-delay: 0.8s;
  --results-panel-delay: 1.1s;
}

body[data-results="1"] .quadrant[data-color="yellow"] {
  --results-exit-delay: 0s;
}

body[data-results="1"] .quadrant[data-color="blue"] {
  --results-exit-delay: 0.12s;
}

body[data-results="1"] .quadrant[data-color="red"] {
  --results-exit-delay: 0.24s;
}

body[data-results="1"] .quadrant[data-color="green"] {
  --results-exit-delay: 0.36s;
}

body[data-results="1"] .quadrant .grid,
body[data-results="1"] .quadrant .shape-task,
body[data-results="1"] .quadrant .memory-task,
body[data-results="1"] .quadrant .drag-task,
body[data-results="1"] .quadrant .task-inline,
body[data-results="1"] .quadrant .timer-dots,
body[data-results="1"] .quadrant .slot,
body[data-results="1"] .quadrant .placeholder,
body[data-results="1"] .quadrant .result-flash {
  animation: taskVanishGrid 0.45s steps(2) 1 forwards;
  animation-delay: var(--results-exit-delay, 0s);
  pointer-events: none;
}

body[data-results="1"] .quadrant .task-inline {
  animation: taskVanishLabel 0.45s steps(2) 1 forwards;
  animation-delay: var(--results-exit-delay, 0s);
}

body[data-phase="lobby"] .placeholder,
body[data-phase="countdown"] .placeholder {
  display: none;
}

body[data-phase="lobby"] .timer-dots,
body[data-phase="countdown"] .timer-dots {
  opacity: 0;
  --timer-offset-y: 6px;
}

body[data-phase="countdown"][data-countdown="prestart"] .timer-dots {
  opacity: 1;
  --timer-offset-y: 0;
  animation: dotsGlitchIn 0.45s steps(2) 1;
}

body[data-phase="countdown"][data-countdown="prestart"] .slot {
  animation: slotGlitchOut 0.45s steps(2) 1 forwards;
}

body[data-safari="1"][data-phase="countdown"][data-countdown="prestart"] .slot {
  animation: slotFadeOut 0.3s ease-out 1 forwards;
  filter: none;
}

body[data-phase="countdown"][data-countdown="prestart"]
  .quadrant[data-color="yellow"]
  .slot {
  animation-delay: 0s;
}

body[data-phase="countdown"][data-countdown="prestart"]
  .quadrant[data-color="blue"]
  .slot {
  animation-delay: 0.12s;
}

body[data-phase="countdown"][data-countdown="prestart"]
  .quadrant[data-color="red"]
  .slot {
  animation-delay: 0.24s;
}

body[data-phase="countdown"][data-countdown="prestart"]
  .quadrant[data-color="green"]
  .slot {
  animation-delay: 0.36s;
}

body[data-phase="lobby"] .task,
body[data-phase="countdown"] .task,
body[data-phase="lobby"] .result,
body[data-phase="countdown"] .result {
  opacity: 0;
  pointer-events: none;
}

body[data-phase="round"] .slot,
body[data-phase="results"] .slot {
  display: none;
}

body[data-phase="results"] .placeholder {
  display: none;
}

body[data-phase="round"] .task-inline {
  opacity: 1;
}

body[data-phase="round"] .success-indicator.active {
  opacity: 1;
}

.quadrant.task-exit .grid,
.quadrant.task-exit .shape-task,
.quadrant.task-exit .memory-task,
.quadrant.task-exit .drag-task {
  animation: taskVanishGrid 0.45s steps(2) 1 forwards;
  pointer-events: none;
}

.quadrant.task-exit .task-inline {
  animation: taskVanishLabel 0.45s steps(2) 1 forwards;
  pointer-events: none;
}

.quadrant.task-enter .grid,
.quadrant.task-enter .shape-task,
.quadrant.task-enter .memory-task,
.quadrant.task-enter .drag-task {
  animation: taskRevealGrid 0.45s steps(2) 1;
}

.quadrant.task-enter .task-inline {
  animation: taskRevealLabel 0.45s steps(2) 1;
}

.quadrant.urgent::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 77, 77, 0.12);
  box-shadow: inset 0 0 120px rgba(255, 77, 77, 0.25);
  opacity: 0.15;
  animation: urgentPulse 0.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

.quadrant.out::before {
  opacity: 0;
  animation: none;
}

.quadrant.out .grid,
.quadrant.out .task-inline,
.quadrant.out .result-flash,
.quadrant.out .memory-task,
.quadrant.out .drag-task {
  opacity: 0;
}

.quadrant.out .grid {
  pointer-events: none;
}

.quadrant.glitch .grid,
.quadrant.glitch .task-inline,
.quadrant.glitch .memory-task,
.quadrant.glitch .drag-task {
  animation: introGlitchOut 0.55s steps(2) 1;
  filter: blur(0.4px);
}

.task-glitch {
  animation: introGlitchOut 0.55s steps(2) 1 forwards;
  filter: blur(0.4px);
  will-change: transform, filter, opacity;
  pointer-events: none;
}

.task-glitch::before,
.task-glitch::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.22);
  mix-blend-mode: screen;
  z-index: 2;
}

.task-glitch::before {
  opacity: 0.75;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-0.04em, -0.03em);
  animation: introGlitchTop 0.55s steps(2) 1 forwards;
}

.task-glitch::after {
  opacity: 0.75;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(0.05em, 0.04em);
  animation: introGlitchBottom 0.55s steps(2) 1 forwards;
}

body[data-phase="round"] .placeholder {
  display: none;
}

@media (max-width: 900px) {
  body[data-phase="round"] .mini-slot,
  body[data-phase="countdown"] .mini-slot {
    display: none;
  }

  body[data-phase="round"] .mini-level,
  body[data-phase="countdown"] .mini-level {
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .mini-level__grid,
  .mini-level__dot,
  .mini-level__bar,
  .mini-level__tile,
  .mini-level__diamond {
    display: none !important;
  }

  .mini-health {
    bottom: 3%;
  }
}

@keyframes dotGain {
  0% {
    transform: scale(0.4);
    opacity: 0;
    background-color: #fff;
    box-shadow: 0 0 0 #fff;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    background-color: #fff;
    box-shadow: 0 0 14px #fff;
  }
  100% {
    transform: scale(1);
    opacity: 1;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
  }
}

@keyframes taskRevealGrid {
  0% {
    opacity: 0;
    transform: translate(0, 0);
    filter: blur(2px) brightness(1.2);
  }
  25% {
    opacity: 0.5;
    transform: translate(-1px, 1px);
  }
  55% {
    opacity: 0.85;
    transform: translate(1px, -1px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
    filter: none;
  }
}

@keyframes taskRevealLabel {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + 0px), 0);
    filter: blur(2px) brightness(1.2);
  }
  25% {
    opacity: 0.5;
    transform: translate(calc(-50% - 1px), 1px);
  }
  55% {
    opacity: 0.85;
    transform: translate(calc(-50% + 1px), -1px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%);
    filter: none;
  }
}

@keyframes taskVanishGrid {
  0% {
    opacity: 1;
    transform: translate(var(--glitch-base-x, 0px), var(--glitch-base-y, 0px))
      scale(var(--glitch-scale, 1));
    filter: none;
  }
  20% {
    opacity: 0.6;
    transform: translate(
        calc(var(--glitch-base-x, 0px) + 2px),
        calc(var(--glitch-base-y, 0px) - 1px)
      )
      scale(var(--glitch-scale, 1));
    filter: contrast(1.3);
  }
  50% {
    opacity: 0.9;
    transform: translate(
        calc(var(--glitch-base-x, 0px) - 2px),
        calc(var(--glitch-base-y, 0px) + 1px)
      )
      scale(var(--glitch-scale, 1));
  }
  75% {
    opacity: 0.3;
    transform: translate(
        calc(var(--glitch-base-x, 0px) + 1px),
        calc(var(--glitch-base-y, 0px) - 2px)
      )
      scale(var(--glitch-scale, 1));
    filter: brightness(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(var(--glitch-base-x, 0px) + 0px),
        calc(var(--glitch-base-y, 0px) - 4px)
      )
      scale(var(--glitch-scale, 1));
    filter: blur(2px);
  }
}

@keyframes taskStaggerIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    transform: scale(1.02);
    filter: none;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: none;
  }
}

@keyframes taskStaggerOut {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: none;
  }
  100% {
    opacity: 0;
    transform: scale(0.88);
    filter: blur(2px);
  }
}

@keyframes taskStaggerFadeIn {
  0% {
    opacity: 0;
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    filter: none;
  }
  100% {
    opacity: 1;
    filter: none;
  }
}

@keyframes taskStaggerFadeOut {
  0% {
    opacity: 1;
    filter: none;
  }
  100% {
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes taskVanishLabel {
  0% {
    opacity: 1;
    transform: translateX(-50%);
    filter: none;
  }
  20% {
    opacity: 0.6;
    transform: translate(calc(-50% + 2px), -1px);
    filter: contrast(1.3);
  }
  50% {
    opacity: 0.9;
    transform: translate(calc(-50% - 2px), 1px);
  }
  75% {
    opacity: 0.3;
    transform: translate(calc(-50% + 1px), -2px);
    filter: brightness(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + 0px), -4px);
    filter: blur(2px);
  }
}

@keyframes taskFailGlitch {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: none;
  }
  15% {
    opacity: 0.95;
    transform: translate(-3px, -2px) scale(1.02);
    filter: contrast(1.6) brightness(1.3);
  }
  45% {
    opacity: 0.8;
    transform: translate(4px, 2px) scale(0.98);
    filter: contrast(1.4) brightness(1.4);
  }
  70% {
    opacity: 0.4;
    transform: translate(-2px, 5px) scale(1.03);
    filter: blur(2px) brightness(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(0, 8px) scale(1.05);
    filter: blur(3px) brightness(1.1);
  }
}

@keyframes taskWhiteGlitchTop {
  0% {
    opacity: 0.35;
    transform: translate(-2px, -1px);
  }
  50% {
    opacity: 0.65;
    transform: translate(-6px, -3px);
  }
  100% {
    opacity: 0;
    transform: translate(-2px, 2px);
  }
}

@keyframes taskWhiteGlitchBottom {
  0% {
    opacity: 0.35;
    transform: translate(2px, 2px);
  }
  50% {
    opacity: 0.65;
    transform: translate(6px, 5px);
  }
  100% {
    opacity: 0;
    transform: translate(2px, 8px);
  }
}

@keyframes miniPulse {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  35% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes urgentPulse {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes clickPulse {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  40% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes remoteClickPulse {
  0% {
    opacity: 0;
    transform: scale(0.75);
  }
  40% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@keyframes trianglePulse {
  0% {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.4));
  }
  40% {
    filter:
      drop-shadow(0 0 10px rgba(0, 0, 0, 0.4))
      drop-shadow(0 0 14px rgba(255, 255, 255, 0.9));
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.4));
  }
}

@keyframes crtCellPulse {
  0% {
    text-shadow: 0 0 6px rgba(75, 255, 122, 0.45), 0 0 12px rgba(75, 255, 122, 0.25);
  }
  100% {
    text-shadow: 0 0 0 rgba(75, 255, 122, 0);
  }
}

@keyframes missPulse {
  0% {
    text-shadow: 0 0 10px rgba(255, 90, 90, 0.75), 0 0 18px rgba(255, 90, 90, 0.45);
  }
  100% {
    text-shadow: 0 0 0 rgba(255, 90, 90, 0);
  }
}

@keyframes glitchOut {
  0% {
    opacity: 1;
    transform: translate(0, 0);
    filter: contrast(1);
  }
  40% {
    opacity: 0.6;
    transform: translate(2px, -2px);
    filter: contrast(1.5);
  }
  100% {
    opacity: 0;
    transform: translate(-2px, 2px);
    filter: contrast(1);
  }
}

@keyframes colorWordGlitch {
  0% {
    opacity: 1;
    transform: translate(0, 0);
    filter: none;
  }
  45% {
    opacity: 0.6;
    transform: translate(2px, -1px);
    filter: brightness(1.3);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
    filter: none;
  }
}
