* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: #000;
  color: #f7f7f7;
  --success-green: #4bff7a;
  --debug-panel-width: clamp(710px, calc(52vw + 30px), 830px);
  --debug-panel-gap: 24px;
  overflow: hidden;
  overscroll-behavior: none;
  cursor: var(--player-cursor), auto;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea,
.join-input {
  user-select: text;
  -webkit-user-select: text;
}

#root {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

@font-face {
  font-family: "OmbudsmanStencil";
  src: url("/assets/OmbudsmanStencil.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body[data-loading="true"] .app-header,
body[data-loading="true"] .stage,
body[data-loading="true"] .sound-toggle {
  opacity: 0;
  pointer-events: none;
}

body[data-phase="join"] .app-header,
body[data-phase="join"] .stage,
body[data-phase="join"] .center-hud,
body[data-phase="join"] .total-time,
body[data-phase="join"] .cursor-layer {
  opacity: 0;
  pointer-events: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 32px;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 1000;
}

body[data-loading="true"] .loading-screen {
  opacity: 1;
  pointer-events: auto;
}

.loading-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 12px;
  overflow: visible;
  padding-top: 2px;
  padding-bottom: 2px;
}

.loading-brand .brand-icon {
  border-left: none;
}

.loading-status {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d9d9d9;
  width: 100%;
  position: relative;
}

body[data-intro="true"] .loading-status {
  opacity: 0;
  visibility: hidden;
}

.intro-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  text-align: center;
}

body[data-intro="true"] .intro-screen {
  opacity: 1;
  pointer-events: auto;
}

.intro-text {
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: clamp(22px, 4vw, 46px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.4;
  max-width: 720px;
  color: #f7f7f7;
  position: relative;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3), 0 0 38px rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .intro-text {
    font-size: clamp(36px, 10vw, 78px);
    letter-spacing: 0.1em;
    white-space: normal;
    max-width: 92vw;
  }
}

.intro-text::before,
.intro-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

body[data-intro-glitch="true"] .intro-text {
  animation: introGlitchOut 0.55s steps(2) 1 forwards;
  filter: blur(0.4px);
}

body[data-intro-glitch="true"] .intro-text::before {
  opacity: 0.75;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-0.04em, -0.03em);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
  animation: introGlitchTop 0.55s steps(2) 1 forwards;
}

body[data-intro-glitch="true"] .intro-text::after {
  opacity: 0.75;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(0.05em, 0.04em);
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
  animation: introGlitchBottom 0.55s steps(2) 1 forwards;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  unicode-bidi: isolate;
  transition: opacity 0.25s ease, color 0.25s ease;
  width: 100%;
  white-space: nowrap;
}

.loading-line[data-line="2"],
.loading-line[data-line="3"] {
  opacity: 0;
  visibility: hidden;
}

.loading-line.visible {
  opacity: 1;
  visibility: visible;
}

.loading-line.dim {
  color: #8c8c8c;
}

.loading-dots {
  font-family: "Menlo", "Courier New", monospace;
  white-space: pre;
  direction: ltr;
  unicode-bidi: isolate;
}

.loading-dots--measure {
  position: absolute;
  left: -9999px;
  top: -9999px;
  visibility: hidden;
  pointer-events: none;
}

.join-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  text-align: left;
}

body[data-phase="join"] .join-screen {
  opacity: 1;
  pointer-events: auto;
}

.join-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.join-screen[data-intro="true"] {
  pointer-events: none;
}

.join-screen[data-intro="true"] .join-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition-duration: 0s;
}

.join-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(720px, 92vw);
  color: #f7f7f7;
  text-align: center;
}

.join-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  overflow: visible;
  padding-top: 2px;
  padding-bottom: 2px;
}

.join-brand .brand-icon {
  width: 34px;
  height: 34px;
}

.join-brand .brand-title {
  font-size: 34px;
}

.join-screen[data-step="code"] .join-card--main {
  display: none;
}

.join-screen[data-step="main"] .join-card--code {
  display: none;
}

.join-title {
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 47px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.join-title.intro-text {
  font-size: clamp(12px, 3.3vw, 46px);
  letter-spacing: clamp(0.04em, 0.9vw, 0.18em);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .join-title.intro-text {
    font-size: clamp(36px, 10vw, 78px);
    letter-spacing: 0.1em;
    white-space: normal;
  }
}

.join-subtitle {
  font-size: 21px;
  max-width: 560px;
  color: #a7afc0;
  line-height: 1.4;
  text-transform: uppercase;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.join-card--code .join-subtitle {
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.join-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.join-button {
  border-radius: 6px;
  border: 1px solid #cf5b4a;
  background: linear-gradient(180deg, #c74a3a 0%, #8f1d14 100%);
  color: #f7f7f7;
  padding: 12px 26px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 21px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: var(--player-cursor), pointer;
}

.join-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.join-link {
  border: none;
  background: transparent;
  color: #cdd5e5;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: var(--player-cursor), pointer;
}

.join-link:disabled {
  opacity: 0.6;
  cursor: default;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  width: min(420px, 90vw);
}

.join-input {
  width: 100%;
  text-align: center;
  background: rgba(9, 12, 18, 0.9);
  border: 1px solid #3a3f4a;
  color: #f7f7f7;
  padding: 12px 16px;
  font-size: 22px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  outline: none;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  position: relative;
  z-index: 9;
}

.header-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9aa4b7;
  text-decoration: none;
  letter-spacing: 0.22em;
  font-size: 22px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.header-channel:hover,
.header-channel:focus-visible {
  color: #f7f7f7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: var(--player-cursor), pointer;
  overflow: visible;
  padding-top: 2px;
  padding-bottom: 2px;
}

.brand-icon {
  width: 22px;
  height: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  position: relative;
  overflow: visible;
}

.brand-icon.glitch {
  animation: logoTextGlitch var(--logo-glitch-duration, 0.75s) steps(2) 1;
  filter: drop-shadow(0.05em 0 0 #00fffc)
    drop-shadow(-0.03em -0.04em 0 #fc00ff)
    drop-shadow(0.025em 0.04em 0 #fffc00);
  will-change: transform, filter;
}

.brand-dot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #f7f7f7;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.brand-dot[data-color="yellow"] {
  background: #f5c542;
}

.brand-dot[data-color="blue"] {
  background: #4b84ff;
}

.brand-dot[data-color="red"] {
  background: #dc0303;
}

.brand-dot[data-color="green"] {
  background: #29a11f;
}

.brand-icon--status .brand-dot {
  background: #6e7686;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}

.brand-icon--status[data-active-color="yellow"] .brand-dot[data-color="yellow"] {
  background: #f5c542;
  box-shadow: 0 0 10px rgba(245, 197, 66, 0.85);
}

.brand-icon--status[data-active-color="blue"] .brand-dot[data-color="blue"] {
  background: #4b84ff;
  box-shadow: 0 0 10px rgba(75, 132, 255, 0.85);
}

.brand-icon--status[data-active-color="red"] .brand-dot[data-color="red"] {
  background: #dc0303;
  box-shadow: 0 0 10px rgba(220, 3, 3, 0.85);
}

.brand-icon--status[data-active-color="green"] .brand-dot[data-color="green"] {
  background: #29a11f;
  box-shadow: 0 0 10px rgba(41, 161, 31, 0.85);
}

.brand-title {
  font-size: 14px;
  letter-spacing: 0.32em;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  position: relative;
  display: inline-block;
  cursor: inherit;
  overflow: visible;
}

.brand-title::before,
.brand-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}

.brand-title.glitch {
  animation: logoTextGlitch var(--logo-glitch-duration, 0.75s) steps(2) 1;
  text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
    0.025em 0.04em 0 #fffc00;
}

.brand-title.glitch::before {
  opacity: 0.75;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-0.04em, -0.03em);
  animation: logoTextGlitchTop var(--logo-glitch-duration, 0.75s) steps(2) 1;
}

.brand-title.glitch::after {
  opacity: 0.75;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(0.04em, 0.03em);
  animation: logoTextGlitchBottom var(--logo-glitch-duration, 0.75s) steps(2) 1;
}

.subtitle {
  margin: 0;
  color: #9aa4b7;
  font-size: 11px;
  letter-spacing: 0.22em;
}

.status {
  position: relative;
  overflow: hidden;
  padding: 6px 12px;
  border-radius: 999px;
  background: radial-gradient(
    circle at center,
    rgba(60, 86, 140, 0.35) 0%,
    rgba(27, 31, 42, 0.95) 55%,
    rgba(16, 18, 24, 0.98) 100%
  );
  color: #9dd4ff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status::before {
  content: "";
  position: absolute;
  inset: -120%;
  background: radial-gradient(
    circle at center,
    rgba(157, 212, 255, 0.5) 0%,
    rgba(157, 212, 255, 0.18) 40%,
    rgba(157, 212, 255, 0) 70%
  );
  opacity: 0;
  transform: scale(0.85);
  animation: statusPulse 2.8s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.connection-status {
  position: relative;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a8396;
}

.connection-status::before,
.connection-status::after {
  content: "";
  display: none;
}

.connection-status.online::before,
.connection-status.online::after {
  animation: none;
}

.connection-status.online::after {
  animation-delay: 0s;
}

.connection-status.offline::before,
.connection-status.offline::after {
  display: none;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.connection-status.online .connection-dot {
  box-shadow: 0 0 8px rgba(var(--accent-rgb, 122, 131, 150), 0.7);
}

.connection-status.offline .connection-dot {
  box-shadow: none;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px 24px;
  user-select: none;
  -webkit-user-select: none;
}

body[data-debug="1"] .stage {
  padding-left: 24px;
}


.stage-grid {
  position: relative;
  width: min(92vw, 1100px);
  height: min(74vh, 780px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  transition: opacity 0.25s ease;
}

body[data-debug="1"] .stage-grid {
  opacity: 0.75;
}

.stage-grid--hidden {
  opacity: 0;
  pointer-events: none;
}

.cursor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.debug-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--debug-cols, 10), 1fr);
  grid-template-rows: repeat(var(--debug-rows, 10), 1fr);
  z-index: 5;
  pointer-events: none;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

.debug-grid__cell {
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2px;
  box-sizing: border-box;
}

.debug-grid__label {
  line-height: 1;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.debug-times {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  z-index: 5;
  pointer-events: none;
  font-family: "Menlo", "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
}

.debug-time {
  padding: 6px 8px;
  align-self: flex-start;
  justify-self: flex-start;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  position: relative;
}

.debug-time__value {
  display: inline-block;
}

.debug-time__bonus {
  position: absolute;
  left: 0;
  top: -8px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #5dff78;
  text-shadow: 0 0 8px rgba(93, 255, 120, 0.6);
  opacity: 0;
  animation: debugBonusFloat 2.6s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

.debug-time[data-col="1"] .debug-time__bonus {
  left: auto;
  right: 0;
  text-align: right;
}

.debug-time[data-row="0"][data-col="1"] {
  justify-self: flex-end;
  text-align: right;
}

.debug-time[data-row="1"][data-col="0"] {
  align-self: flex-end;
}

.debug-time[data-row="1"][data-col="1"] {
  align-self: flex-end;
  justify-self: flex-end;
  text-align: right;
}

.debug-time[data-color="yellow"] {
  color: #f5c542;
}

.debug-time[data-color="blue"] {
  color: #4b84ff;
}

.debug-time[data-color="red"] {
  color: #dc0303;
}

.debug-time[data-color="green"] {
  color: #29a11f;
}

@keyframes debugBonusFloat {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.remote-cursor {
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
  color: inherit;
}

.remote-cursor[data-color="yellow"] {
  color: #f5c542;
}

.remote-cursor[data-color="blue"] {
  color: #4b84ff;
}

.remote-cursor[data-color="red"] {
  color: #dc0303;
}

.remote-cursor[data-color="green"] {
  color: #29a11f;
}

.remote-cursor svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.cursor-debug {
  position: absolute;
  transform: translate(14px, 18px);
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Menlo", "Courier New", monospace;
  font-size: 10px;
  line-height: 1.2;
  color: var(--accent, rgba(255, 255, 255, 0.8));
  white-space: nowrap;
  pointer-events: none;
  z-index: 7;
}

.cursor-debug--self {
  font-weight: 600;
}

.stage-dividers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  --divider-gap: 80px;
}

.stage-divider {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
}

.stage-divider.divider-vertical {
  width: 1px;
  left: 50%;
  transform: translateX(-0.5px);
}

.stage-divider.divider-horizontal {
  height: 1px;
  top: 50%;
  transform: translateY(-0.5px);
}

.stage-divider.divider-top {
  top: 0;
  height: calc(50% - var(--divider-gap));
}

.stage-divider.divider-bottom {
  bottom: 0;
  height: calc(50% - var(--divider-gap));
}

.stage-divider.divider-left {
  left: 0;
  width: calc(50% - var(--divider-gap));
}

.stage-divider.divider-right {
  right: 0;
  width: calc(50% - var(--divider-gap));
}

.success-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.success-indicator {
  position: absolute;
}

.success-indicator[data-color="yellow"] {
  top: 25%;
  left: 25%;
}

.success-indicator[data-color="blue"] {
  top: 25%;
  left: 75%;
}

.success-indicator[data-color="red"] {
  top: 75%;
  left: 25%;
}

.success-indicator[data-color="green"] {
  top: 75%;
  left: 75%;
}

.super-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.super-stage.active {
  opacity: 1;
  pointer-events: auto;
  animation: taskRevealGrid 0.45s steps(2) 1 var(--super-stage-delay, 0.25s);
  animation-fill-mode: both;
}

.super-stage.exit {
  animation: taskVanishGrid 0.45s steps(2) 1 forwards;
  pointer-events: none;
}

.super-title {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(92vw, 1100px);
  text-align: center;
  font-size: 30px;
  white-space: nowrap;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cdd5e5;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  line-height: 1.05;
  z-index: 2;
  pointer-events: none;
}

.super-title__short {
  display: none;
}

.super-field {
  position: absolute;
  inset: 0;
}

.super-timer-dots {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}

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

.super-timer-dots .dot.filled {
  background: #f7f7f7;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.super-circle {
  position: absolute;
  width: 56px;
  height: 56px;
  border: none;
  padding: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--player-cursor), pointer;
  color: inherit;
  z-index: 1;
}

.super-circle.miss {
  animation: superMissGlow 0.45s ease;
}

.super-circle.miss .super-circle__stroke {
  stroke: #ff9940;
}

.super-circle__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.super-circle__stroke {
  stroke-linecap: round;
}

.super-circle__label {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2ch;
  z-index: 1;
  color: #f7f7f7;
  font-size: 25px;
  font-family: "OmbudsmanStencil", "Menlo", "Courier New", monospace;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  transform: translate(-50%, -50%);
}

.super-circle.removing .super-circle__stroke {
  animation: superBorderErase 0.65s linear forwards;
}

.super-circle.removing .super-circle__label {
  animation: superCircleFade 0.15s linear forwards;
  animation-delay: 0.65s;
}

.quadrant {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  --task-footer-clearance: clamp(28px, 6vmin, 48px);
}

.quadrant.all-out-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 92, 92, 0.55),
    rgba(255, 92, 92, 0)
  );
  opacity: 0;
  transform: scale(0.92);
  animation: allOutFlash 0.32s ease-out;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}



.slot {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.result-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.7);
  --glitch-scale: 0.7;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(var(--flash-color), 0.55), rgba(var(--flash-color), 0));
  filter: blur(6px);
  mix-blend-mode: screen;
}

.success-indicator {
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  color: currentColor;
  opacity: 0;
  pointer-events: none;
  --arrow-offset-x: 0px;
  --arrow-offset-y: 0px;
  --arrow-rotate: 0deg;
}

.success-indicator .plus {
  width: 28px;
  height: 28px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.success-indicator .plus::before,
.success-indicator .plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 5px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  border-radius: 4px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.success-indicator .plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.success-indicator .arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-50%, -50%) rotate(var(--arrow-rotate));
  opacity: 0;
}

.success-indicator.dir-right {
  --arrow-rotate: 0deg;
}

.success-indicator.dir-left {
  --arrow-rotate: 180deg;
}

.success-indicator.dir-up {
  --arrow-rotate: -90deg;
}

.success-indicator.dir-down {
  --arrow-rotate: 90deg;
}

.success-indicator.active {
  animation: indicatorPulse 2.5s ease-out;
}

.success-indicator.active .plus {
  animation: plusFade 2.5s ease-out;
}

.success-indicator.active .arrow {
  animation: arrowFly 2.5s ease-out;
}

.result-flash.success {
  --flash-color: 80, 255, 140;
  background: radial-gradient(
    circle at var(--flash-origin, 50% 50%),
    rgba(var(--flash-color), 0.45) 0%,
    rgba(var(--flash-color), 0.2) 35%,
    rgba(var(--flash-color), 0) 60%
  );
  animation: flashPulse 1.2s ease-out;
}

.result-flash.fail {
  --flash-color: 255, 92, 92;
  background: radial-gradient(
    circle at var(--flash-origin, 50% 50%),
    rgba(var(--flash-color), 0.45) 0%,
    rgba(var(--flash-color), 0.2) 35%,
    rgba(var(--flash-color), 0) 60%
  );
  animation: flashPulse 1.2s ease-out;
}

.slot .check {
  width: 72px;
  height: 56px;
  display: grid;
  place-items: center;
  color: currentColor;
  position: relative;
}

.slot .check svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
}

.slot .check svg .check-stroke {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}

.slot .check svg .check-fill {
  opacity: 0;
}

.slot .check svg .check-reveal {
  transform: scaleX(0);
  transform-origin: left center;
  transform-box: fill-box;
}


.slot.filled .check {
  opacity: 1;
}

.slot.filled .check svg .check-stroke {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkDraw 0.7s ease-out forwards;
}

.slot.filled .check svg .check-fill {
  animation: checkFill 0.7s ease-out forwards;
}

.slot.filled .check svg .check-reveal {
  animation: checkReveal 0.7s ease-out forwards;
}

.slot.empty .check {
  opacity: 1;
}

.slot.empty .check svg {
  filter: none;
}

.slot.empty .check svg .check-stroke {
  fill: none;
  stroke: #919191;
  opacity: 0.65;
  stroke-width: 1.1;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}

.slot.empty .check svg .check-fill {
  fill: none;
  opacity: 0;
  animation: none;
}

.slot.empty .check svg .check-reveal {
  transform: scaleX(0);
  animation: none;
}


body[data-phase="disconnected"] .stage-grid {
  opacity: 0;
  pointer-events: none;
}


.slot-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.slot-divider {
  width: 100%;
  max-width: 110px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.slot .label {
  font-size: 36px;
  color: #f7f7f7;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.slot .ip {
  font-size: 11px;
  color: #8d96a9;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.center-hud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
  z-index: 4;
  width: min(92vw, 1100px);
}

.center-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 10px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  pointer-events: none;
  z-index: 4;
  text-align: center;
}

.team-code {
  color: #9aa4b7;
}

body[data-phase="lobby"] .team-code {
  cursor: pointer;
  pointer-events: auto;
}

.team-code__label {
  white-space: nowrap;
  position: relative;
  display: inline-block;
}

.team-code__label::before,
.team-code__label::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

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

.team-code__label.glitch::before {
  opacity: 0.75;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-0.04em, -0.03em);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
  animation: introGlitchTop 0.55s steps(2) 1;
}

.team-code__label.glitch::after {
  opacity: 0.75;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(0.05em, 0.04em);
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
  animation: introGlitchBottom 0.55s steps(2) 1;
}

.team-code__value {
  font-size: 30px;
  letter-spacing: 0.12em;
  color: #f7f7f7;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

body[data-phase="round"] .team-code,
body[data-phase="countdown"] .team-code,
body[data-phase="results"] .team-code {
  opacity: 0;
}

.center-hud .control-row {
  pointer-events: auto;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

button {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #f6d04d;
  background: transparent;
  color: #f6d04d;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: var(--player-cursor), pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

button:disabled {
  opacity: 0.4;
  cursor: var(--player-cursor), not-allowed;
}

.super-circle.locked {
  opacity: 1;
}

.super-circle {
  touch-action: manipulation;
}

.mobile-hud {
  display: none;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.mobile-hud[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.mobile-hud__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.mobile-team-code {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 9px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  color: #9aa4b7;
  cursor: pointer;
  pointer-events: auto;
}

.mobile-team-code__value {
  font-size: 18px;
  letter-spacing: 0.12em;
  color: #f7f7f7;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.mobile-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.mobile-timer__label {
  font-size: 9px;
  color: #9aa4b7;
}

.mobile-timer__value {
  font-size: 26px;
  color: #f7f7f7;
}

.selection-count {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #9aa4b7;
  text-transform: uppercase;
}

.result {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9dd4ff;
  min-height: 16px;
}

.connection-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  pointer-events: none;
}

.connection-banner__label {
  font-size: 34px;
  line-height: 1.1;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  color: #f7f7f7;
}

.connection-banner__meta {
  font-size: 11px;
  letter-spacing: 0.26em;
  color: #9aa4b7;
}

.results-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  background: rgba(5, 6, 10, 0.92);
  --results-delay: var(--results-panel-delay, 0.6s);
  --results-scale: 1;
  overflow-x: hidden;
  overflow-y: hidden;
}

.results-panel.active {
  pointer-events: auto;
  opacity: 1;
  animation: taskRevealGrid 0.45s steps(2) 1 var(--results-delay, 0.6s) both;
}

.results-panel.active .results-card > * {
  opacity: 0;
  animation: resultsGlitchIn 0.6s steps(2) forwards;
  animation-delay: calc(var(--results-delay, 0.6s) + 0.1s);
}

.results-panel.active .results-card > *:nth-child(2) {
  animation-delay: calc(var(--results-delay, 0.6s) + 0.25s);
}

.results-panel.active .results-card > *:nth-child(3) {
  animation-delay: calc(var(--results-delay, 0.6s) + 0.4s);
}

.results-panel.active .results-card > *:nth-child(4) {
  animation-delay: calc(var(--results-delay, 0.6s) + 0.55s);
}

body[data-safari="1"] .super-stage.active {
  animation: superStageFadeIn 0.25s ease-out var(--super-stage-delay, 0.25s) both;
}

body[data-safari="1"] .super-stage.exit {
  animation: superStageFadeOut 0.2s ease-in forwards;
}

body[data-safari="1"] .results-panel.active {
  animation: resultsPanelFadeIn 0.25s ease-out var(--results-delay, 0.6s) both;
}

body[data-safari="1"] .results-panel.active .results-card > * {
  animation: resultsItemFadeIn 0.25s ease-out forwards;
  animation-delay: calc(var(--results-delay, 0.6s) + 0.1s);
  filter: none;
  transform: none;
}

body[data-safari="1"] .results-panel.active .results-card > *:nth-child(2) {
  animation-delay: calc(var(--results-delay, 0.6s) + 0.25s);
}

body[data-safari="1"] .results-panel.active .results-card > *:nth-child(3) {
  animation-delay: calc(var(--results-delay, 0.6s) + 0.4s);
}

body[data-safari="1"] .results-panel.active .results-card > *:nth-child(4) {
  animation-delay: calc(var(--results-delay, 0.6s) + 0.55s);
}

body[data-safari="1"] .slot .check svg {
  filter: none;
}

.results-card {
  width: min(94vw, calc(1200px * var(--results-scale)));
  display: flex;
  flex-direction: column;
  gap: calc(28px * var(--results-scale));
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f7f7f7;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
}

.results-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  letter-spacing: 0.32em;
  margin-bottom: 8px;
  overflow: visible;
  padding-top: 2px;
  padding-bottom: 2px;
}

.results-brand .brand-icon {
  width: 34px;
  height: 34px;
}

.results-brand .brand-title {
  font-size: 34px;
  letter-spacing: 0.32em;
}

.results-title {
  font-size: calc(96px * var(--results-scale));
  letter-spacing: 0.12em;
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

.results-subtitle {
  font-size: calc(28px * var(--results-scale));
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #9aa4b7;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.5;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: calc(48px * var(--results-scale));
  align-items: start;
}

.results-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.results-label {
  font-size: calc(18px * var(--results-scale));
  letter-spacing: 0.2em;
  color: #9aa4b7;
}

.results-time {
  font-size: calc(32px * var(--results-scale));
  letter-spacing: 0.14em;
  position: relative;
  padding-bottom: 10px;
}


.results-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  --avg-line: 0.5;
  --track-width: calc(160px * var(--results-scale));
  --track-height: calc(275px * var(--results-scale));
}

.results-progress__dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.results-progress__dots .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}


.results-progress__track {
  width: var(--track-width);
  height: var(--track-height);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: flex-end;
  position: relative;
}

.results-progress__track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--avg-line) * 100%);
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.results-progress__fill {
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, #4bff7a, #1ea44b);
  transition: height 1.4s ease;
  position: relative;
  overflow: hidden;
}

.results-panel[data-time-result="below"] .results-progress__fill,
.results-progress__fill[data-time-result="below"] {
  background: linear-gradient(180deg, #ff6b6b 0%, #b31212 100%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.18) 0px,
      rgba(255, 255, 255, 0.18) 1px,
      rgba(255, 255, 255, 0) 2px,
      rgba(255, 255, 255, 0) 4px
    );
  box-shadow: 0 0 12px rgba(255, 88, 88, 0.6), 0 0 24px rgba(255, 88, 88, 0.25);
}

.results-panel[data-time-result="below"] .results-progress__fill::after,
.results-progress__fill[data-time-result="below"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 35%, rgba(0, 0, 0, 0.2));
  opacity: 0.6;
  mix-blend-mode: screen;
}

.results-progress__avg {
  font-size: calc(24px * var(--results-scale));
  color: #9aa4b7;
}

.results-progress__marker {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--track-height);
  position: relative;
  top: calc((0.5 - var(--avg-line)) * var(--track-height));
}

.results-ability {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-ability-title {
  font-size: calc(60px * var(--results-scale));
  letter-spacing: 0.18em;
  position: relative;
  padding-bottom: 10px;
}

.results-ability-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 220px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
}

.results-metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.results-metric__label {
  font-size: calc(39px * var(--results-scale));
  color: #cdd5e5;
}

.results-metric__bar {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.results-metric__fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #ff4b4b, #c30d0d);
  transition: width 1.4s ease;
}

.results-metric__avg {
  position: absolute;
  top: -7px;
  width: 0;
  height: 24px;
  border-left: 2px solid rgba(255, 255, 255, 0.55);
  left: 50%;
}

.results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 16px;
}

.results-copy {
  border: 1px solid #6a707c;
  background: linear-gradient(180deg, #4a4f59 0%, #2a2f37 100%);
  color: #f7f7f7;
  padding: 12px 26px;
  font-size: calc(16px * var(--results-scale));
  letter-spacing: 0.2em;
  border-radius: 6px;
  text-transform: uppercase;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  cursor: var(--player-cursor), pointer;
}

.results-actions {
  display: flex;
  gap: 12px;
}

.results-actions button {
  border: 1px solid #6a707c;
  background: linear-gradient(180deg, #4a4f59 0%, #2a2f37 100%);
  color: #f7f7f7;
  padding: 12px 26px;
  font-size: calc(16px * var(--results-scale));
  letter-spacing: 0.2em;
  border-radius: 6px;
  text-transform: uppercase;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

@media (min-width: 2560px) {
  .results-panel {
    --results-scale: 1.35;
  }
}

@media (min-width: 3840px) {
  .results-panel {
    --results-scale: 1.6;
  }
}

@media (min-width: 901px) and (max-height: 980px) {
  .results-panel {
    --results-scale: 0.9;
  }
}

@media (min-width: 901px) and (max-height: 880px) {
  .results-panel {
    --results-scale: 0.82;
  }
}

@media (min-width: 901px) and (max-height: 780px) {
  .results-panel {
    --results-scale: 0.74;
  }
}

.sound-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.sound,
.simulation {
  padding: 10px 24px;
  font-size: 18px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8d96a9;
  cursor: var(--player-cursor), pointer;
  position: relative;
  z-index: 7;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sound.off,
.simulation.off {
  color: #556074;
}

[data-color="yellow"] {
  --accent: #f5c542;
  --accent-rgb: 245, 197, 66;
  --accent-light: #ffe38a;
  --accent-dark: #f2b51f;
  color: #f5c542;
  --flash-origin: 100% 100%;
}

[data-color="blue"] {
  --accent: #4b84ff;
  --accent-rgb: 75, 132, 255;
  --accent-light: #8bb7ff;
  --accent-dark: #2f64ff;
  color: #4b84ff;
  --flash-origin: 0% 100%;
}

[data-color="red"] {
  --accent: #dc0303;
  --accent-rgb: 220, 3, 3;
  --accent-light: #ff5a5a;
  --accent-dark: #dc0303;
  color: #dc0303;
  --flash-origin: 100% 0%;
}

[data-color="green"] {
  --accent: #29a11f;
  --accent-rgb: 41, 161, 31;
  --accent-light: #6adf60;
  --accent-dark: #29a11f;
  color: #29a11f;
  --flash-origin: 0% 0%;
}

@media (max-width: 900px) {
  body,
  #root {
    height: 100dvh;
    overflow: hidden;
  }

  .stage-grid {
    width: min(96vw, 540px);
    height: min(70vh, 540px);
    height: min(70dvh, 540px);
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .stage {
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: center;
  }

  .center-hud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }

  .stage-grid {
    grid-row: 1;
  }

  .center-hud {
    width: min(92vw, 540px);
  }

  body[data-phase="disconnected"] .center-hud {
    inset: 0;
    width: 100%;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-header {
    padding: 12px 14px;
    gap: 12px;
  }

  .header-channel {
    display: none;
  }

  .brand {
    display: none;
  }

  .mobile-hud {
    display: flex;
    flex: 1;
    justify-content: space-between;
  }

  .mobile-hud__right {
    margin-right: 40px;
  }

  .mobile-timer__label {
    font-size: 12px;
  }

  .mobile-timer__value {
    font-size: 32px;
  }

  .mobile-team-code {
    font-size: 11px;
  }

  .mobile-team-code__value {
    font-size: 24px;
  }

  .sound-toggle {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

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

  body[data-phase="lobby"] .center-hud .team-code {
    display: none;
  }

  .super-circle {
    width: clamp(32px, 9vw, 42px);
    height: clamp(32px, 9vw, 42px);
  }

  .super-circle__stroke {
    stroke-width: 5px;
  }

  .super-circle__label {
    font-size: 16px;
  }

  .super-circle.locked {
    opacity: 0.7;
  }

  .super-title {
    font-size: 14px;
    max-width: 92vw;
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: 0.08em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .super-title__full {
    display: none;
  }

  .super-title__short {
    display: block;
  }

  .super-stage.active {
    animation: superRevealMobile 0.3s ease 1 both;
  }

  .super-stage.exit {
    animation: superVanishMobile 0.25s ease 1 forwards;
  }

  body[data-super="1"] .super-timer-dots {
    display: flex;
    left: 50%;
    right: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
  }

  body[data-super="1"] .super-field {
    inset: 12% 6% 14% 6%;
  }

  .super-round-time {
    position: fixed;
    right: 16px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
    pointer-events: none;
    z-index: 7;
  }

  .super-round-time__label {
    font-size: 9px;
    color: #9aa4b7;
  }

  .super-round-time__value {
    font-size: 20px;
    color: #f7f7f7;
  }

  .super-timer-dots {
    bottom: 14px;
    gap: 5px;
  }

  @keyframes superRevealMobile {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  @keyframes superVanishMobile {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }

  .stage {
    padding: 8px max(12px, env(safe-area-inset-left), env(safe-area-inset-right)) 18px;
  }

  .stage-dividers {
    display: none;
  }

  .stage-grid--self .quadrant:not([data-self="true"]) {
    display: none;
  }

  .stage-grid--self .quadrant[data-self="true"] {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    padding: 14px;
  }

  .stage-grid--self .success-indicator:not([data-self="true"]) {
    display: none;
  }

  .stage-grid--self .success-indicator[data-self="true"] {
    top: 50%;
    left: 50%;
  }

  .total-time {
    display: none;
  }

  .results-panel {
    align-items: flex-start;
    padding: 20px 0 calc(20px + env(safe-area-inset-bottom));
  }

  body[data-results="1"] .results-panel.active {
    animation: resultsPanelRevealMobile 0.45s steps(2) 1 var(--results-delay, 0.6s) both;
  }

  body[data-results="1"] .results-panel.active .results-card > * {
    animation: resultsGlitchInMobile 0.6s steps(2) forwards;
    filter: none;
  }

  .results-card {
    gap: 18px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 0 10px calc(16px + env(safe-area-inset-bottom));
  }

  .results-title {
    font-size: 44px;
  }

  .results-brand {
    margin-top: 4px;
    margin-bottom: 8px;
  }

  .results-brand .brand-title {
    font-size: 34px;
    letter-spacing: 0.32em;
  }

  .results-subtitle {
    font-size: 16px;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .results-progress {
    --track-width: 120px;
    --track-height: 180px;
  }

  .results-ability-title {
    font-size: 34px;
  }

  .results-metric__label {
    font-size: 22px;
  }

  .results-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .results-actions {
    flex-direction: column;
  }
}

@keyframes flashPulse {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  35% {
    opacity: 0.7;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

@keyframes allOutFlash {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  35% {
    opacity: 0.75;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes statusPulse {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  35% {
    opacity: 0.8;
    transform: scale(1);
  }
  70% {
    opacity: 0.25;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

@keyframes introGlitchOut {
  0% {
    opacity: 1;
    transform: translate(0, 0);
    filter: blur(0);
  }
  35% {
    opacity: 1;
    transform: translate(-1px, 0);
    filter: blur(0.6px);
  }
  70% {
    opacity: 0.7;
    transform: translate(1px, -2px);
    filter: blur(1.6px);
  }
  100% {
    opacity: 0;
    transform: translate(0, 4px);
    filter: blur(3.5px);
  }
}

@keyframes introGlitchTop {
  0% {
    opacity: 0.5;
    transform: translate(-0.04em, -0.02em);
  }
  50% {
    opacity: 0.8;
    transform: translate(-0.1em, -0.04em);
  }
  100% {
    opacity: 0;
    transform: translate(-0.02em, 0.02em);
  }
}

@keyframes introGlitchBottom {
  0% {
    opacity: 0.5;
    transform: translate(0.04em, 0.04em);
  }
  50% {
    opacity: 0.8;
    transform: translate(0.1em, 0.06em);
  }
  100% {
    opacity: 0;
    transform: translate(0.02em, 0.08em);
  }
}

@keyframes checkDraw {
  0% {
    stroke-dashoffset: 100;
    opacity: 0.2;
  }
  60% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes checkFill {
  0% {
    opacity: 0;
  }
  45% {
    opacity: 0.9;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes checkReveal {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes indicatorPulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes arrowFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--arrow-rotate)) scale(0.75);
  }
  15% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: translate(
        calc(-50% + var(--arrow-offset-x)),
        calc(-50% + var(--arrow-offset-y))
      )
      rotate(var(--arrow-rotate))
      scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--arrow-offset-x)),
        calc(-50% + var(--arrow-offset-y))
      )
      rotate(var(--arrow-rotate))
      scale(1.05);
  }
}

@keyframes connectionRipple {
  0% {
    opacity: 0.65;
    transform: scale(0.4);
  }
  70% {
    opacity: 0.1;
    transform: scale(2.4);
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}


@keyframes logoTextGlitch {
  0%,
  15% {
    text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
      0.025em 0.04em 0 #fffc00;
    transform: translate(0, 0);
    filter: none;
  }
  16%,
  49% {
    text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
      -0.05em -0.05em 0 #fffc00;
    transform: translate(-1px, -1px);
    filter: contrast(1.2);
  }
  50%,
  99% {
    text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
      0 -0.04em 0 #fffc00;
    transform: translate(1px, 1px);
    filter: brightness(1.1);
  }
  100% {
    text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff,
      -0.04em -0.025em 0 #fffc00;
    transform: translate(-1px, 0);
    filter: none;
  }
}

@keyframes logoTextGlitchTop {
  0% {
    transform: translate(-0.04em, -0.03em);
  }
  50% {
    transform: translate(-0.02em, 0.02em);
  }
  100% {
    transform: translate(-0.03em, -0.01em);
  }
}

@keyframes logoTextGlitchBottom {
  0% {
    transform: translate(0.04em, 0.03em);
  }
  50% {
    transform: translate(0.02em, -0.02em);
  }
  100% {
    transform: translate(0.03em, 0.02em);
  }
}

@keyframes plusFade {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  60% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
  }
}

@keyframes slotGlitchOut {
  0% {
    opacity: 1;
    transform: translateY(0);
    filter: none;
  }
  20% {
    opacity: 0.4;
    transform: translate(2px, -1px);
  }
  40% {
    opacity: 0.9;
    transform: translate(-2px, 1px);
  }
  60% {
    opacity: 0.2;
    transform: translate(3px, 0);
  }
  80% {
    opacity: 0.6;
    transform: translate(-1px, -2px);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px);
    filter: blur(2px);
  }
}

@keyframes slotFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes dotsGlitchIn {
  0% {
    opacity: 0;
    transform: translate(-50%, 4px);
    filter: blur(2px);
  }
  25% {
    opacity: 0.4;
    transform: translate(calc(-50% - 1px), 0);
  }
  55% {
    opacity: 0.8;
    transform: translate(calc(-50% + 1px), -1px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
    filter: none;
  }
}

@keyframes superBorderErase {
  0% {
    stroke-dasharray: var(--circumference) var(--circumference);
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dasharray: 0 var(--circumference);
    stroke-dashoffset: var(--circumference);
    opacity: 0;
  }
}

@keyframes superCircleFade {
  to {
    opacity: 0;
  }
}

@keyframes superMissGlow {
  0% {
    box-shadow: 0 0 0 rgba(255, 153, 64, 0);
  }
  35% {
    box-shadow: 0 0 14px rgba(255, 153, 64, 0.85);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 153, 64, 0);
  }
}

@keyframes resultsGlitchIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px) brightness(1.2);
  }
  40% {
    opacity: 0.6;
    transform: translate(-2px, 2px);
    filter: blur(1px) brightness(1.4);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
    filter: none;
  }
}

@keyframes taskRevealGridNoBlur {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  25% {
    opacity: 0.5;
    transform: translate(-1px, 1px);
  }
  55% {
    opacity: 0.85;
    transform: translate(1px, -1px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes superStageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes superStageFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes resultsPanelFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes resultsItemFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes resultsPanelRevealMobile {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  25% {
    opacity: 0.5;
    transform: translate(-1px, 1px);
  }
  55% {
    opacity: 0.85;
    transform: translate(1px, -1px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes resultsGlitchInMobile {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  40% {
    opacity: 0.6;
    transform: translate(-2px, 2px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

.total-time {
  color: #f7f7f7;
  opacity: 0;
}

.total-time.countdown-active {
  pointer-events: auto;
}

.total-label {
  white-space: nowrap;
}

.total-time .total-value {
  font-size: 30px;
  letter-spacing: 0.12em;
  color: #f7f7f7;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
}

.total-time.visible {
  opacity: 1;
}

.countdown-skip {
  border: none;
  background: transparent;
  color: #9aa4b7;
  text-decoration: none;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  text-transform: uppercase;
  cursor: var(--player-cursor), pointer;
  padding: 0;
}

.countdown-skip:hover,
.countdown-skip:focus-visible {
  color: #f7f7f7;
}

.debug-log-panel {
  position: fixed;
  left: 16px;
  top: 84px;
  bottom: 24px;
  width: var(--debug-panel-width);
  max-width: var(--debug-panel-width);
  z-index: 20;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 6, 10, 0.88);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.debug-log-panel--right {
  left: auto;
  right: 16px;
}

.debug-log__title {
  padding: 10px 12px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #cdd5e5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-log__dock {
  margin-left: auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 14, 22, 0.9);
  color: rgba(255, 255, 255, 0.8);
  font-size: 8px;
  letter-spacing: 0.2em;
  padding: 3px 8px;
  cursor: var(--player-cursor), pointer;
  text-transform: uppercase;
}

.debug-bots {
  padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.debug-bots__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-bots__title {
  flex: 1;
}

.debug-bots__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-bots__label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.debug-bots__input {
  width: 52px;
  background: rgba(5, 6, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f7f7f7;
  font-size: 10px;
  font-family: "Menlo", "Courier New", monospace;
  padding: 4px 6px;
}

.debug-bots__toggle,
.debug-bots__apply {
  border-radius: 999px;
  border: 1px solid rgba(245, 208, 77, 0.6);
  background: transparent;
  color: #f5d04d;
  font-size: 8px;
  letter-spacing: 0.18em;
  padding: 4px 10px;
  cursor: var(--player-cursor), pointer;
}

.debug-bots__toggle[data-active="true"] {
  color: #1dfb6b;
  border-color: rgba(29, 251, 107, 0.6);
}

.debug-round {
  padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.debug-round__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-round__title {
  flex: 1;
}

.debug-round__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-round__label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.debug-round__select {
  width: 180px;
  background: rgba(5, 6, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f7f7f7;
  font-size: 10px;
  font-family: "Menlo", "Courier New", monospace;
  padding: 4px 6px;
}

.debug-round__apply,
.debug-round__super {
  border-radius: 999px;
  border: 1px solid rgba(120, 176, 255, 0.6);
  background: transparent;
  color: #78b0ff;
  font-size: 8px;
  letter-spacing: 0.18em;
  padding: 4px 10px;
  cursor: var(--player-cursor), pointer;
}

.debug-round__apply:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.debug-round__super {
  border-color: rgba(255, 106, 106, 0.6);
  color: #ff6a6a;
}

.debug-filters {
  padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "OmbudsmanStencil", "Inter", "Segoe UI", sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.debug-filters__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.debug-filters__title {
  flex: 1;
}

.debug-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.debug-filters__toggle,
.debug-filters__apply {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 8px;
  letter-spacing: 0.18em;
  padding: 3px 8px;
  cursor: var(--player-cursor), pointer;
}

.debug-filters__toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.debug-filters__toggle[data-active="true"] {
  color: var(--log-color, #cdd5e5);
  border-color: var(--log-color, #cdd5e5);
}

.debug-filters__apply {
  border-color: rgba(120, 176, 255, 0.6);
  color: #78b0ff;
}

.debug-log__list {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  flex: 1;
  font-family: "Menlo", "Courier New", monospace;
  font-size: 10px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.debug-log__footer {
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "Menlo", "Courier New", monospace;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.55);
}

.debug-log__build {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.debug-log__build-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
}

.debug-log__build-value {
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}

.debug-log__list::-webkit-scrollbar {
  width: 6px;
}

.debug-log__list::-webkit-scrollbar-track {
  background: transparent;
}

.debug-log__list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.debug-log__row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
  word-break: break-word;
  border-left: 2px solid var(--log-color, rgba(255, 255, 255, 0.2));
  padding-left: 6px;
}

.debug-log__time {
  color: rgba(255, 255, 255, 0.45);
}

.debug-log__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.debug-log__tag {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--log-color, #cdd5e5);
  white-space: nowrap;
}

.debug-log__direction {
  color: rgba(255, 255, 255, 0.45);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.debug-log__payload {
  white-space: pre-wrap;
  color: rgba(255, 255, 255, 0.75);
}

.debug-log__row[data-category="cursor"],
.debug-filters__toggle[data-category="cursor"] {
  --log-color: #9dd4ff;
}

.debug-log__row[data-category="drag"],
.debug-filters__toggle[data-category="drag"] {
  --log-color: #f6d04d;
}

.debug-log__row[data-category="task"],
.debug-filters__toggle[data-category="task"] {
  --log-color: #7de390;
}

.debug-log__row[data-category="time"],
.debug-filters__toggle[data-category="time"] {
  --log-color: #ffb36b;
}

.debug-log__row[data-category="round"],
.debug-filters__toggle[data-category="round"] {
  --log-color: #ff6a6a;
}

.debug-log__row[data-category="super"],
.debug-filters__toggle[data-category="super"] {
  --log-color: #6ee7ff;
}

.debug-log__row[data-category="lobby"],
.debug-filters__toggle[data-category="lobby"] {
  --log-color: #8bb7ff;
}

.debug-log__row[data-category="match"],
.debug-filters__toggle[data-category="match"] {
  --log-color: #cdd5e5;
}

.debug-log__row[data-category="debug"],
.debug-filters__toggle[data-category="debug"] {
  --log-color: #ffb454;
}

.debug-log__row[data-category="system"],
.debug-filters__toggle[data-category="system"] {
  --log-color: #9aa4b7;
}

.debug-log__row[data-category="other"],
.debug-filters__toggle[data-category="other"] {
  --log-color: #c7cfdf;
}

.debug-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

@media (max-width: 900px) {
  .debug-log-panel {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    bottom: 12px;
    max-height: 40vh;
  }

  body[data-debug="1"] .stage {
    padding-left: 12px;
    padding-right: 12px;
  }

  body[data-debug="1"] .stage-grid {
    width: min(92vw, 1100px);
  }
}
