:root {
  color-scheme: dark;
  --black: #05070b;
  --studio: #111318;
  --ink: #181d29;
  --white: #ffffff;
  --system: #f5f5f7;
  --grey: #86868b;
  --sapphire: #006fe6;
  --cyan: #4ee7ff;
  --orange: #ff6b21;
  --yellow: #ffcf3d;
  font-family: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, #102d59 0, #080d18 34rem, var(--black) 70rem),
    var(--black);
  color: var(--system);
}

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(0, 111, 230, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 111, 230, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.arcade {
  width: min(96vw, 1540px);
  margin: clamp(12px, 2.2vh, 30px) auto;
}

.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 2px 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.autosocials-logo {
  display: block;
  width: clamp(150px, 15vw, 215px);
  height: 42px;
  object-fit: contain;
  padding: 5px 9px;
  border: 1px solid #313b4a;
  border-radius: 4px;
  background: var(--system);
}

.partner-lockup {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid #344054;
}

.partner-lockup small {
  width: 48px;
  color: #6f7e94;
  font: 700 7px/1.2 "Courier New", monospace;
  letter-spacing: 0.08em;
}

.partner-lockup img {
  display: block;
  width: 105px;
  height: 31px;
  object-fit: contain;
  padding: 4px 7px;
  border-radius: 3px;
  background: var(--white);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  border: 1px solid #263044;
  background: rgba(17, 19, 24, 0.7);
  min-height: 34px;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--sapphire);
  outline: 2px solid rgba(0, 111, 230, 0.28);
}

.game-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  background: #02040a;
  border: clamp(3px, 0.35vw, 6px) solid #222a38;
  box-shadow:
    0 0 0 1px #536074,
    0 0 0 8px #090c12,
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 70px rgba(0, 111, 230, 0.16);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
  background: #050914;
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #d9f3ff;
  background:
    radial-gradient(circle at 50% 44%, rgba(0, 111, 230, 0.22), transparent 34%),
    #02050c;
  transition: opacity 180ms steps(4), visibility 180ms;
}

.loading-screen.ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen p {
  margin: 4px 0 0;
  font-size: clamp(10px, 1vw, 15px);
  font-weight: 900;
  letter-spacing: 0.16em;
}

.loading-screen small {
  color: #6fa6d8;
  font-size: clamp(7px, 0.62vw, 10px);
  letter-spacing: 0.12em;
}

.loader-mark {
  position: relative;
  width: 58px;
  height: 58px;
  animation: loader-pulse 0.9s steps(4) infinite;
}

.loader-mark::before,
.loader-mark span,
.loader-mark i,
.loader-mark b {
  content: "";
  position: absolute;
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid #81d9ff;
  background: #006fe6;
  box-shadow: 0 0 14px rgba(0, 111, 230, 0.8);
}

.loader-mark::before { left: 22px; top: 22px; background: #030912; }
.loader-mark span { left: 4px; top: 5px; border-color: #ff9a58; background: #ff6b21; }
.loader-mark i { right: 3px; top: 3px; }
.loader-mark b { left: 22px; bottom: 1px; }

.loader-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px solid #006fe6;
  transform: rotate(45deg);
}

.loading-track {
  width: min(46vw, 310px);
  height: 10px;
  padding: 2px;
  border: 1px solid #31577e;
  background: #07101d;
  box-shadow: 3px 3px 0 #000;
}

.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #006fe6, #4ee7ff);
  box-shadow: 0 0 10px rgba(78, 231, 255, 0.6);
  transition: width 120ms steps(5);
}

@keyframes loader-pulse {
  50% { filter: brightness(1.5); transform: scale(1.05); }
}

.scanlines,
.bezel-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 18;
}

.scanlines {
  opacity: 0.18;
  mix-blend-mode: overlay;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0,
    rgba(255, 255, 255, 0.08) 1px,
    rgba(0, 0, 0, 0.12) 1px,
    rgba(0, 0, 0, 0.12) 3px
  );
}

.bezel-shine {
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.62),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.title-screen,
.pause-screen,
.result-screen {
  position: absolute;
  inset: 0;
  z-index: 12;
}

.title-screen {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(22px, 4.4vw, 72px);
}

.title-image,
.title-vignette {
  position: absolute;
  inset: 0;
}

.title-image {
  background: url("assets/art-direction-master.webp") center / cover no-repeat;
  image-rendering: pixelated;
  filter: saturate(1.05) contrast(1.03) brightness(0.68);
  transform: scale(1.015);
}

.title-vignette {
  background:
    linear-gradient(90deg, rgba(2, 5, 12, 0.98) 0, rgba(2, 5, 12, 0.92) 28%, rgba(2, 5, 12, 0.38) 59%, rgba(2, 5, 12, 0.18)),
    linear-gradient(0deg, rgba(2, 5, 12, 0.88), transparent 35%, rgba(2, 5, 12, 0.4));
}

.title-content {
  position: relative;
  width: min(45%, 570px);
  min-width: 430px;
  z-index: 2;
  text-shadow: 3px 3px 0 #03050a;
}

.eyebrow {
  margin: 0 0 12px;
  color: #7acaff;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: clamp(8px, 0.75vw, 12px);
}

h1 {
  margin: 0;
  line-height: 0.8;
  letter-spacing: -0.08em;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(52px, 6.1vw, 106px);
  font-style: italic;
  transform: skewY(-2deg);
}

h1 span,
h1 strong {
  display: block;
}

h1 span {
  color: var(--white);
  -webkit-text-stroke: 2px #0b1421;
}

h1 strong {
  color: #147bf2;
  background: linear-gradient(#6de9ff 0 18%, #1987ff 35%, #0052bb 72%, #002d73 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px #0a336b;
  filter: drop-shadow(0 4px 0 #06101f);
}

.title-copy {
  max-width: 520px;
  color: #d6dfec;
  margin: 18px 0 16px;
  font: 600 clamp(10px, 0.88vw, 14px) / 1.45 Arial, Helvetica, sans-serif;
}

.title-copy strong {
  color: var(--cyan);
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.mode-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  color: #9da9bb;
  background: rgba(5, 9, 17, 0.86);
  border: 1px solid #30394a;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.mode-card:hover,
.mode-card:focus-visible,
.mode-card.selected {
  color: var(--white);
  border-color: #268cff;
  background: rgba(0, 50, 112, 0.83);
  outline: none;
}

.mode-card.selected {
  box-shadow:
    inset 0 0 0 1px #63b8ff,
    0 0 18px rgba(0, 111, 230, 0.28);
}

.mode-card b,
.mode-card small {
  display: block;
}

.mode-card b {
  font-size: clamp(7px, 0.63vw, 10px);
  letter-spacing: 0.04em;
}

.mode-card small {
  margin-top: 3px;
  font-size: clamp(6px, 0.52vw, 8px);
  opacity: 0.76;
  white-space: nowrap;
}

.mode-key {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  height: 28px;
  color: #86d8ff;
  border: 1px solid currentColor;
  background: #071628;
  font-weight: 900;
}

.start-button {
  min-width: 240px;
  border: 0;
  padding: 12px 18px;
  color: var(--white);
  background: var(--sapphire);
  box-shadow:
    inset 0 3px 0 #4ab0ff,
    inset 0 -4px 0 #003d8f,
    4px 4px 0 #020817;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: skewX(-5deg);
}

.start-button > * {
  transform: skewX(5deg);
}

.start-button small {
  display: block;
  margin-top: 4px;
  color: #bce8ff;
  font-size: 8px;
}

.start-button:hover,
.start-button:focus-visible {
  background: #168cff;
  outline: 2px solid #8ddcff;
  outline-offset: 3px;
  transform: skewX(-5deg) translate(-1px, -1px);
}

.start-button:disabled {
  cursor: wait;
  filter: saturate(0.25) brightness(0.65);
  transform: skewX(-5deg);
}

.title-footer {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 3vw, 48px);
  right: clamp(20px, 3vw, 48px);
  bottom: clamp(12px, 1.4vw, 24px);
  display: flex;
  justify-content: space-between;
  color: #8d9cb0;
  font-size: clamp(6px, 0.56vw, 9px);
  letter-spacing: 0.12em;
}

.blink {
  color: var(--yellow);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0.2; }
}

.pause-screen,
.result-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(2, 5, 12, 0.88);
  backdrop-filter: blur(5px);
}

.pause-screen p {
  color: var(--cyan);
  font-size: clamp(18px, 2.8vw, 46px);
  font-weight: 900;
  letter-spacing: 0.11em;
  text-shadow: 3px 3px 0 #00366c;
}

.pause-screen button {
  width: 220px;
  margin: 5px;
  padding: 10px;
  border: 1px solid #315277;
  background: #0a1728;
  cursor: pointer;
}

.pause-screen button:hover {
  background: #063b78;
  border-color: var(--cyan);
}

.result-screen {
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 111, 230, 0.35), transparent 38%),
    rgba(2, 5, 12, 0.94);
}

.result-screen h2 {
  margin: 0 0 10px;
  font: italic 900 clamp(36px, 6vw, 98px) / 0.75 Impact, sans-serif;
  letter-spacing: -0.03em;
  color: #d7efff;
  text-shadow: 5px 5px 0 #001f4b;
}

.result-screen h2 strong {
  color: #319aff;
}

.result-line {
  display: inline-block;
  margin: 3px 8px;
  color: #9cabc0;
  font-size: clamp(8px, 0.8vw, 13px);
}

.result-line b {
  color: var(--white);
}

.result-cta {
  margin: clamp(12px, 1.5vw, 24px) 0;
  padding: clamp(12px, 1.3vw, 20px) clamp(18px, 2vw, 32px);
  border: 1px solid #204d80;
  background: rgba(3, 20, 40, 0.8);
}

.result-cta small {
  color: #59baff;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.result-cta p {
  margin: 8px 0 12px;
  font: 700 clamp(12px, 1.3vw, 21px) Arial, sans-serif;
}

.result-cta a {
  color: var(--white);
  text-decoration: none;
  background: var(--sapphire);
  padding: 8px 13px;
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.control-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.5vw, 40px);
  padding: 17px 8px 6px;
  color: #75839a;
  font-size: clamp(8px, 0.68vw, 11px);
  letter-spacing: 0.04em;
}

.control-strip div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-strip b {
  color: #dce7f8;
}

.control-strip kbd {
  min-width: 21px;
  padding: 3px 5px;
  color: #aadeff;
  background: #111824;
  border: 1px solid #2c3b52;
  border-bottom-width: 2px;
  text-align: center;
}

.player-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

.xsiv-dot { color: #298cff; background: currentColor; }
.brad-dot { color: #ff6b21; background: currentColor; }

.mobile-controls {
  position: absolute;
  inset: auto 0 7px;
  z-index: 9;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 max(12px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  pointer-events: none;
}

.mobile-controls button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  border: 1px solid rgba(120, 210, 255, 0.48);
  background: rgba(0, 23, 53, 0.7);
  color: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.mobile-controls button.is-active {
  color: #fff;
  border-color: #8ceaff;
  background: rgba(0, 111, 230, 0.9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), 0 0 18px rgba(0, 111, 230, 0.65);
}

.dpad {
  position: relative;
  width: clamp(116px, 30vw, 138px);
  height: clamp(116px, 30vw, 138px);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 7px;
  border: 1px solid rgba(120, 210, 255, 0.3);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(7, 32, 67, 0.78), rgba(1, 9, 21, 0.62) 70%);
  box-shadow: inset 0 0 20px rgba(0, 111, 230, 0.2), 0 5px 18px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  touch-action: none;
}

.dpad button { pointer-events: none; opacity: 0.6; }

.dpad button:nth-child(1) { grid-area: 1 / 2; }
.dpad button:nth-child(2) { grid-area: 2 / 1; }
.dpad button:nth-child(3) { grid-area: 3 / 2; }
.dpad button:nth-child(4) { grid-area: 2 / 3; }

.joystick-thumb {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px;
  border: 2px solid rgba(153, 231, 255, 0.72);
  border-radius: 50%;
  background: rgba(0, 67, 142, 0.86);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.05), 0 0 16px rgba(0, 111, 230, 0.34);
  pointer-events: none;
  transition: transform 65ms linear;
}

.actions {
  width: clamp(144px, 38vw, 164px);
  height: clamp(100px, 27vw, 112px);
  position: relative;
}

.actions button {
  width: clamp(52px, 14vw, 58px);
  height: clamp(52px, 14vw, 58px);
  border-radius: 50%;
  position: absolute;
  font-weight: 900;
}

.action-attack { right: 0; bottom: 22px; }
.action-special { right: 58px; top: 0; }
.action-dash { left: 0; bottom: 0; }

@media (max-width: 760px) {
  body { place-items: start center; }
  .arcade { width: 100vw; margin: 0; }
  .topbar { padding-inline: 10px; }
  .autosocials-logo { width: 142px; height: 32px; padding: 4px 7px; }
  .partner-lockup { display: none; }
  .button-label { display: none; }
  .game-shell { border-left: 0; border-right: 0; }
  .title-screen { padding: 18px; align-items: flex-end; }
  .title-vignette {
    background:
      linear-gradient(0deg, rgba(2, 5, 12, 0.99) 0, rgba(2, 5, 12, 0.88) 54%, rgba(2, 5, 12, 0.2)),
      linear-gradient(90deg, rgba(2, 5, 12, 0.35), transparent);
  }
  .title-content { width: 100%; min-width: 0; }
  .eyebrow, .title-copy { display: none; }
  h1 { font-size: clamp(38px, 12vw, 70px); }
  .mode-picker { margin-top: 10px; }
  .mode-card { min-height: 42px; }
  .mode-card small { display: none; }
  .start-button { min-width: 185px; padding: 9px 12px; }
  .title-footer, .control-strip { display: none; }
  .mobile-controls.active { display: flex; }
}

@media (hover: none) and (pointer: coarse) {
  .mobile-controls.active { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}
