.arcade-cabinet {
  position: relative;
  max-width: 380px;
  margin-left: auto;
  padding: 8px;
  background: linear-gradient(180deg, #1a1020 0%, #0c0618 50%, #06040e 100%);
  border: 2px solid #2a1a3a;
  border-radius: 24px 24px 16px 16px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 30px 60px -20px rgba(0, 0, 0, 0.9),
    0 0 80px rgba(255, 45, 149, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.arcade-cabinet.is-focused {
  border-color: var(--yellow);
  box-shadow:
    inset 0 0 0 1px rgba(255, 212, 0, 0.2),
    0 30px 60px -20px rgba(0, 0, 0, 0.9),
    0 0 60px rgba(255, 212, 0, 0.35);
}

.arcade-cabinet.is-focused::after {
  content: "● LIVE · USE WASD / ↑↓←→ · CLICK OUTSIDE TO EXIT";
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(255, 212, 0, 0.5);
  pointer-events: none;
}

.cabinet-marquee {
  height: 36px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #ff2d95 0%, #ff6fd6 50%, #ff2d95 100%);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 0 28px rgba(255, 45, 149, 0.4);
  display: flex;
  align-items: center;
}

.cabinet-marquee::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 14px,
    rgba(0, 0, 0, 0.08) 14px 15px
  );
  pointer-events: none;
}

.marquee-text {
  font-family: var(--font-arcade);
  font-size: 12px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  letter-spacing: 0.08em;
  white-space: nowrap;
  animation: marquee-scroll 18s linear infinite;
  padding-left: 100%;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.cabinet-screen {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 12px;
  background:
    radial-gradient(
      ellipse at 30% 20%,
      rgba(0, 240, 255, 0.08),
      transparent 60%
    ),
    radial-gradient(
      ellipse at 70% 80%,
      rgba(255, 45, 149, 0.08),
      transparent 60%
    ),
    #04040e;
  overflow: hidden;
  border: 6px solid #05030a;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.04),
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    inset 0 0 80px rgba(0, 240, 255, 0.06);
}

.cabinet-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
  z-index: 4;
  opacity: 0.5;
}

.cabinet-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.6) 100%
  );
  pointer-events: none;
  z-index: 4;
}

.cabinet-screen canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.mini-game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 5;
  text-align: center;
  padding: 20px;
  gap: 16px;
}

.mini-game-title {
  font-family: var(--font-arcade);
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
  color: var(--yellow);
  text-shadow: 0 0 20px rgba(255, 212, 0, 0.5);
}

.mini-game-overlay p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  max-width: 280px;
  margin: 0;
}

.insert-coin-btn {
  animation: insert-coin-blink 0.9s ease-in-out infinite;
}

@keyframes insert-coin-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 212, 0, 0.4);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.98);
    box-shadow: 0 0 6px rgba(255, 212, 0, 0.2);
  }
}

.mini-game-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mini-game-badge .live {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.2s infinite;
}

.cabinet-panel {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #18102a 0%, #0d0820 100%);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.6),
    inset 0 -2px 0 rgba(255, 255, 255, 0.03);
  align-items: center;
}

.cabinet-joystick {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.dpad {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, #2a1f42 0%, #14091f 100%);
  color: var(--ink-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.08s ease;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5);
}

.dpad-up {
  grid-column: 2;
  grid-row: 1;
  border-radius: 6px 6px 0 0;
}

.dpad-left {
  grid-column: 1;
  grid-row: 2;
  border-radius: 6px 0 0 6px;
}

.dpad-right {
  grid-column: 3;
  grid-row: 2;
  border-radius: 0 6px 6px 0;
}

.dpad-down {
  grid-column: 2;
  grid-row: 3;
  border-radius: 0 0 6px 6px;
}

.dpad-center {
  grid-column: 2;
  grid-row: 2;
  background: linear-gradient(180deg, #1a0f2a 0%, #08040f 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.dpad:hover {
  color: var(--cyan);
}

.dpad.active {
  background: linear-gradient(180deg, #00f0ff 0%, #008ea0 100%);
  color: #000;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    0 0 16px rgba(0, 240, 255, 0.6);
  transform: scale(0.95);
}

.cabinet-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.cabinet-keyreadout {
  font-family: var(--font-arcade);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: #04040e;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.08);
  min-width: 90px;
}

.krlabel {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.krvalue {
  font-size: 12px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  letter-spacing: 0;
}

.arcade-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  width: 80px;
  height: 40px;
  border-radius: 8px;
  position: relative;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
  background: transparent;
}

.arcade-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  background: var(--btn-color, #ff3d5e);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    inset 0 4px 0 rgba(255, 255, 255, 0.3),
    0 4px 0 rgba(0, 0, 0, 0.5),
    0 0 16px var(--btn-glow, rgba(255, 61, 94, 0.4));
  transition: all 0.08s ease;
}

.arcade-btn:active::before {
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 1px 0 rgba(0, 0, 0, 0.5),
    0 0 24px var(--btn-glow, rgba(255, 61, 94, 0.6));
  transform: translateY(3px);
}

.arcade-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: radial-gradient(circle, #1a0f2a 0%, #08040f 100%);
  z-index: -1;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.ab-red {
  --btn-color: #ff3d5e;
  --btn-glow: rgba(255, 61, 94, 0.5);
}

.ab-yellow {
  --btn-color: #ffd400;
  --btn-glow: rgba(255, 212, 0, 0.5);
}

.ab-label {
  position: relative;
  z-index: 2;
  font-family: var(--font-arcade);
  font-size: 8px;
  color: rgba(0, 0, 0, 0.7);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.keycap {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  margin: 0 2px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}
