:root {
  /* Authentic Tekken 3 Arcade Palette */
  --t3-bg: #09090b;
  --t3-panel-bg: rgba(18, 19, 25, 0.96);
  --t3-panel-mid: #151720;
  --t3-panel-border: #2a2c3a;
  --t3-panel-border-bright: #ff5500;

  --t3-fire-yellow: #fff200;
  --t3-fire-orange: #ff5500;
  --t3-fire-red: #d90429;
  --t3-fire-dark: #660000;

  --t3-cyan: #00f0ff;
  --t3-green: #00ff88;
  --t3-gold: #f9c80e;
  --t3-white: #ffffff;
  --t3-subtext: #a0a3b5;
  --t3-muted: #55586b;

  /* Typography */
  --t3-font-heading: 'Teko', 'Impact', sans-serif;
  --t3-font-tech: 'Chakra Petch', 'Segoe UI', monospace, sans-serif;

  /* Legacy Bridge Tokens */
  --bg-color: var(--t3-bg);
  --card-bg: var(--t3-panel-mid);
  --text-main: var(--t3-cyan);
  --text-sub: var(--t3-subtext);
  --accent-cyan: var(--t3-cyan);
  --accent-red: var(--t3-fire-red);
  --accent-yellow: var(--t3-gold);
  --accent-green: var(--t3-green);
  --panel-border: var(--t3-panel-border);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: clip;
  overflow-y: auto;
  background-color: var(--t3-bg);
  font-family: var(--t3-font-tech);
  color: var(--t3-subtext);
  touch-action: manipulation;
}

/* Authentic Japanese Arcade Carbon Fiber Background */
.bg-grid {
  position: fixed;
  inset: 0;
  background-color: #08080a;
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(217, 4, 41, 0.15) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 85, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 85, 0, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* App container */
#app {
  position: relative;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* SCREEN CONTAINER */
.screen {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  min-height: 100vh;
}

#screen-game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
}

/* Global Hidden Utility */
.hidden,
.screen.hidden {
  display: none !important;
}

/* ARCADE TOP MARQUEE */
.arcade-marquee {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: rgba(14, 15, 20, 0.95);
  border: 1px solid var(--t3-panel-border);
  border-bottom: 2px solid var(--t3-fire-orange);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--t3-subtext);
  margin-bottom: 12px;
}

.marquee-spec {
  display: flex;
  gap: 8px;
  align-items: center;
}

.spec-label {
  color: var(--t3-muted);
  font-weight: 700;
}

.spec-val {
  color: var(--t3-gold);
  font-weight: 700;
}

.marquee-tag {
  color: #fff;
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 0.72rem;
}

.blink-live {
  color: var(--t3-green);
  animation: arcadePulse 1.2s infinite;
}

@keyframes arcadePulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px var(--t3-green); }
  50% { opacity: 0.4; text-shadow: none; }
}

/* FIERY TEKKEN 3 LOGO BANNER */
.tekken-banner {
  text-align: center;
  margin-bottom: 18px;
}

.kanji-badge {
  display: inline-block;
  background: linear-gradient(135deg, #d90429, #660000);
  border: 1px solid var(--t3-gold);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 2px 14px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  margin-bottom: 4px;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.5);
}

.tekken-title {
  font-family: var(--t3-font-heading);
  font-size: clamp(3.2rem, 7.5vw, 5.8rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #fff200 20%, #ff5500 55%, #d90429 85%, #4a0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 85, 0, 0.7)) drop-shadow(0 3px 0 #000);
  margin: 0;
}

.tekken-sub {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--t3-gold);
  text-transform: uppercase;
  margin-top: 4px;
  text-shadow: 0 0 8px rgba(249, 200, 14, 0.4);
}

.arcade-alert {
  background: rgba(217, 4, 41, 0.2);
  border: 1px solid var(--t3-fire-red);
  color: #ff6677;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 960px;
  text-align: center;
}

/* MAIN ARCADE TERMINAL */
.arcade-cabinet {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arcade-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  width: 100%;
}

@media (max-width: 768px) {
  .arcade-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* MULTI-GAME SELECTION CAROUSEL */
.game-select-section {
  background: rgba(15, 17, 24, 0.95);
  border: 1.5px solid var(--t3-panel-border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.game-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--t3-panel-border) transparent;
  padding-bottom: 6px;
}

.game-carousel::-webkit-scrollbar {
  height: 4px;
}

.game-carousel::-webkit-scrollbar-thumb {
  background: var(--t3-panel-border);
  border-radius: 2px;
}

.game-card {
  flex: 1 0 155px;
  min-width: 155px;
  background: rgba(22, 26, 36, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  background: rgba(30, 36, 50, 0.9);
}

.game-card.active {
  border-color: var(--t3-fire-orange);
  background: rgba(255, 85, 0, 0.12);
  box-shadow: 0 0 16px rgba(255, 85, 0, 0.35);
  transform: translateY(-2px);
}

.game-card.active[data-game="doubledragon3"] {
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.35);
}

.card-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--t3-font-tech);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 1px;
}

.psx-badge {
  background: #ff5500;
  color: #fff;
}

.nes-badge {
  background: #e60012;
  color: #fff;
}

.card-name {
  font-family: var(--t3-font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--t3-subtext);
  letter-spacing: 0.5px;
}

/* NES 2-BUTTON ARCADE PREVIEW */
.nes-preview-box {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  padding: 24px 12px;
  margin: 10px auto;
}

.nes-key-pill {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff3344 0%, #aa0011 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.8), inset 0 2px 2px rgba(255, 255, 255, 0.4);
}

.nes-key-sym {
  font-family: var(--t3-font-heading);
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.nes-key-name {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
  text-align: center;
}

/* CABINET PANELS */
.cabinet-col {
  background: linear-gradient(180deg, rgba(22, 24, 32, 0.96) 0%, rgba(13, 14, 18, 0.98) 100%);
  border: 1.5px solid var(--t3-panel-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.cabinet-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--t3-fire-orange), transparent);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.panel-icon {
  font-size: 1.1rem;
}

.panel-title {
  font-family: var(--t3-font-heading);
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}

/* ARCADE BUTTONS & ACTIONS */
.mode-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arcade-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--t3-font-heading);
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  border: 1.5px solid var(--t3-panel-border);
  background: linear-gradient(180deg, #242634 0%, #14151e 100%);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  outline: none;
}

.arcade-btn:hover {
  transform: translateY(-2px);
  border-color: var(--t3-fire-orange);
  box-shadow: 0 4px 15px rgba(255, 85, 0, 0.35);
}

.arcade-btn:active {
  transform: translateY(1px);
}

.btn-slot {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--t3-gold);
  border-radius: 2px;
  margin-right: 12px;
}

.btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  text-align: left;
}

.btn-main-text {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
}

.btn-sub-text {
  font-family: var(--t3-font-tech);
  font-size: 0.65rem;
  color: var(--t3-subtext);
  letter-spacing: 1px;
  margin-top: 3px;
}

.btn-arrow {
  font-size: 0.9rem;
  color: var(--t3-gold);
  margin-left: 8px;
}

/* SPECIFIC BUTTON FLAVORS */
.btn-fire {
  background: linear-gradient(180deg, #d90429 0%, #880010 100%);
  border-color: #ffb703;
  box-shadow: 0 0 14px rgba(217, 4, 41, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-fire:hover {
  background: linear-gradient(180deg, #ff2a00 0%, #b80018 100%);
  border-color: #fff200;
  box-shadow: 0 0 22px rgba(255, 85, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-solo {
  background: linear-gradient(180deg, #1d2b3a 0%, #0e1620 100%);
  border-color: var(--t3-cyan);
}

.btn-solo:hover {
  background: linear-gradient(180deg, #25394e 0%, #14202e 100%);
  border-color: #fff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.btn-solo.solo-primary {
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.45) 0%, rgba(217, 4, 41, 0.55) 100%);
  border-color: var(--t3-orange);
  box-shadow: 0 0 24px rgba(255, 85, 0, 0.5), inset 0 0 12px rgba(255, 85, 0, 0.3);
  padding: 18px 22px;
}

.btn-solo.solo-primary:hover {
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.6) 0%, rgba(217, 4, 41, 0.7) 100%);
  border-color: #ffd700;
  box-shadow: 0 0 32px rgba(255, 85, 0, 0.8), inset 0 0 18px rgba(255, 215, 0, 0.4);
}

.btn-solo.solo-primary .btn-slot {
  background: var(--t3-orange);
  color: #000;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.6);
}

.btn-enter {
  flex: 1;
  width: auto;
  min-width: 0;
  white-space: nowrap;
  background: linear-gradient(180deg, #ff8c00 0%, #c44000 100%);
  border-color: #ffd700;
  font-size: 1.25rem;
  padding: 8px 14px;
  justify-content: center;
  gap: 8px;
}

.btn-enter:hover {
  background: linear-gradient(180deg, #ffa500 0%, #e04a00 100%);
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.6);
}

/* DIVIDER */
.arcade-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.divider-text {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--t3-muted);
  font-weight: 700;
}

/* JOIN TERMINAL FORM */
.join-terminal {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.code-slot {
  flex: 0 0 175px;
  min-width: 175px;
  display: flex;
  flex-direction: column;
}

.code-label {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: var(--t3-subtext);
  margin-bottom: 4px;
}

.input-arcade-code {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid var(--t3-panel-border);
  color: var(--t3-gold);
  font-family: var(--t3-font-heading);
  font-size: 1.35rem;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  padding: 6px 10px;
  outline: none;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input-arcade-code:focus {
  border-color: var(--t3-fire-orange);
  box-shadow: 0 0 12px rgba(255, 85, 0, 0.5);
}

/* FIGHTSTICK & CONTROLS PANEL */
.fightstick-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stick-legend {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stick-badge {
  background: #252838;
  border: 1px solid var(--t3-panel-border);
  color: var(--t3-gold);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 3px;
}

.legend-desc {
  font-size: 0.72rem;
  color: var(--t3-subtext);
}

/* PLAYSTATION ATTACK DIAMOND */
.arcade-diamond-preview {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 10px auto;
}

.atk-button {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--t3-font-tech);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8), inset 0 2px 2px rgba(255, 255, 255, 0.2);
  border: 2px solid transparent;
}

.atk-symbol {
  font-size: 0.95rem;
  line-height: 1;
}

.atk-name {
  font-size: 0.6rem;
  line-height: 1;
  color: #fff;
}

.atk-key {
  position: absolute;
  bottom: -6px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.55rem;
  padding: 0 4px;
  border-radius: 2px;
  color: #fff;
}

.btn-lp { top: 0; left: 43px; border-color: #ff3399; color: #ff66cc; background: rgba(255, 51, 153, 0.2); }
.btn-rp { top: 43px; right: 0; border-color: #00ff88; color: #33ffaa; background: rgba(0, 255, 136, 0.2); }
.btn-lk { bottom: 0; left: 43px; border-color: #00d4ff; color: #66e5ff; background: rgba(0, 212, 255, 0.2); }
.btn-rk { top: 43px; left: 0; border-color: #ff3344; color: #ff6677; background: rgba(255, 51, 68, 0.2); }

.macro-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.chip {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  font-size: 0.72rem;
  color: var(--t3-subtext);
}

.chip-key {
  color: var(--t3-gold);
  font-weight: 700;
}

.intel-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.btn-settings {
  font-size: 1rem;
  padding: 6px 12px;
  justify-content: center;
  border-color: rgba(255, 255, 255, 0.2);
}

.intel-tag {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--t3-green);
  text-align: center;
}

/* SCREEN 2: WAITING ROOM */
.col-waiting {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.waiting-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 15px 0;
}

.btn-whatsapp {
  background: linear-gradient(180deg, #25d366 0%, #128c7e 100%);
  border-color: #25d366;
}

.btn-whatsapp:hover {
  background: linear-gradient(180deg, #2cf074 0%, #16a896 100%);
  box-shadow: 0 0 18px rgba(37, 211, 102, 0.5);
}

.btn-cancel {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--t3-subtext);
  font-size: 1rem;
  padding: 8px;
  justify-content: center;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
  color: #fff;
}

.waiting-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--t3-cyan);
  letter-spacing: 1.5px;
  margin-bottom: 15px;
}

.arcade-radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t3-cyan);
  box-shadow: 0 0 10px var(--t3-cyan);
  animation: radarBlink 1s infinite alternate;
}

@keyframes radarBlink {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.room-display {
  margin: 15px 0;
}

.room-label {
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--t3-gold);
  margin-bottom: 8px;
}

.room-code-badge {
  font-family: var(--t3-font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--t3-fire-orange);
  padding: 6px 24px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  display: inline-block;
  text-shadow: 0 0 20px var(--t3-fire-orange);
  box-shadow: 0 0 25px rgba(255, 85, 0, 0.4);
}

/* GAMEPLAY VIEWPORT */
#game-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

#game-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: min(133.33vh, 100%); /* Strict 4:3 with zero viewport overflow */
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game, #remote-video, #game canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* MATCH HUD OVERLAY */
#match-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(11, 12, 16, 0.85);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(102, 252, 241, 0.3);
  font-size: 0.82rem;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.25s ease;
}

#match-hud.hud-minimized {
  transform: translate(-50%, -130%);
  opacity: 0;
  pointer-events: none;
}

.hud-expand-pill {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 101;
  background: rgba(22, 26, 36, 0.85);
  border: 1.5px solid var(--t3-panel-border);
  color: var(--t3-gold);
  font-family: var(--t3-font-tech);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hud-expand-pill.hidden {
  display: none !important;
}

.hud-expand-pill:hover, .hud-expand-pill:active {
  background: var(--t3-gold);
  color: #000;
}

.btn-hud-min {
  background: rgba(255, 85, 0, 0.2) !important;
  border: 1px solid #ff5500 !important;
  color: #ffaa00 !important;
  font-weight: bold;
  cursor: pointer;
}

#match-hud button {
  pointer-events: auto;
}

/* DIAGNOSTIC CONSOLE OVERLAY (Corner-Docked, Translucent, Minimizable) */
.diag-console {
  position: absolute;
  bottom: 12px;
  right: 12px;
  top: auto;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: 200px;
  background: rgba(11, 12, 16, 0.85);
  border: 1px solid rgba(102, 252, 241, 0.35);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: max-height 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}

.diag-console.hidden {
  display: none !important;
}

.diag-console.minimized {
  max-height: 34px;
  width: auto;
  min-width: 140px;
  opacity: 0.85;
}

.diag-console.minimized .diag-entries {
  display: none;
}

.diag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(31, 40, 51, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--text-main);
  font-weight: bold;
}

.diag-actions {
  display: flex;
  gap: 5px;
}

.diag-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.2;
}

.diag-btn:hover {
  background: var(--text-main);
  color: #0b0c10;
}

.diag-entries {
  padding: 8px 10px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.72rem;
  color: #c5c6c7;
  line-height: 1.4;
  flex: 1;
  text-align: left;
}

.diag-line {
  margin-bottom: 3px;
  word-break: break-all;
}

.diag-line.err { color: #ff3366; }
.diag-line.ok { color: #66fcf1; }
.diag-line.warn { color: #ffcc00; }

.hud-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* MOBILE TOUCH CONTROLS (Full Screen Spanning into Black Bars) */
#touch-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
  display: none;
  touch-action: none !important;
}

#touch-overlay, #touch-overlay * {
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.touch-active {
  touch-action: none !important;
}

body.touch-active #touch-overlay {
  display: block;
}

/* Suppress generic EmulatorJS virtual gamepad to eliminate duplicate controls */
#ejs-gamepad, .ejs-virtual-gamepad, .ejs_gamepad, [id*="ejs-virtual"] {
  display: none !important;
}

/* 8-WAY D-PAD (Left Side, Smooth 360-Degree Rolling D-Pad) */
.touch-dpad {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 175px;
  height: 175px;
  pointer-events: auto;
  touch-action: none !important;
  background: rgba(14, 16, 22, 0.6);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
}

.dpad-center {
  position: absolute;
  inset: 54px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.dpad-btn {
  position: absolute;
  background: rgba(26, 30, 42, 0.7);
  border: 1.5px solid rgba(102, 252, 241, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: bold;
  user-select: none;
  touch-action: none !important;
  transition: transform 0.04s ease, background 0.04s ease;
  pointer-events: none; /* Touches are tracked by .touch-dpad container */
}

.dpad-btn:active, .dpad-btn.pressed {
  background: rgba(102, 252, 241, 0.85);
  color: #0b0c10;
  transform: scale(0.92);
  box-shadow: 0 0 15px rgba(102, 252, 241, 0.8);
}

.dpad-up { top: 4px; left: 59px; width: 57px; height: 52px; border-radius: 10px 10px 0 0; }
.dpad-down { bottom: 4px; left: 59px; width: 57px; height: 52px; border-radius: 0 0 10px 10px; }
.dpad-left { top: 59px; left: 4px; width: 52px; height: 57px; border-radius: 10px 0 0 10px; }
.dpad-right { top: 59px; right: 4px; width: 52px; height: 57px; border-radius: 0 10px 10px 0; }

/* Diagonal Visual Feedback (Down-Back, Down-Forward, Up-Back, Up-Forward) */
.dpad-diag {
  position: absolute;
  width: 56px;
  height: 56px;
  touch-action: none !important;
  background: transparent;
  pointer-events: none;
  transition: background 0.04s ease;
}
.dpad-ul { top: 4px; left: 4px; border-radius: 50% 0 0 0; }
.dpad-ur { top: 4px; right: 4px; border-radius: 0 50% 0 0; }
.dpad-dl { bottom: 4px; left: 4px; border-radius: 0 0 0 50%; }  /* Down-Back */
.dpad-dr { bottom: 4px; right: 4px; border-radius: 0 0 50% 0; }  /* Down-Forward */

.dpad-diag:active, .dpad-diag.pressed {
  background: rgba(102, 252, 241, 0.45);
  box-shadow: 0 0 12px rgba(102, 252, 241, 0.6);
}

/* ACTION & GRAB BUTTONS (Right Side, Positioned Neatly in Right Black Bar) */
.touch-actions {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  touch-action: none !important;
}

/* NES Touch Cluster */
.nes-touch-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 175px;
}

.nes-touch-buttons {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: center;
}

.nes-touch-buttons .action-btn {
  position: static;
  width: 66px;
  height: 66px;
  font-size: 1.35rem;
}

/* Macro Row (Positioned Cleanly ABOVE the Attack Diamond) */
.macro-group {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  width: 175px;
  justify-content: space-between;
}

.macro-btn {
  width: 38px;
  height: 34px;
  border-radius: 6px;
  background: rgba(22, 26, 36, 0.7);
  border: 1px solid var(--t3-panel-border);
  color: var(--t3-gold);
  font-family: var(--t3-font-tech);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  touch-action: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.04s ease;
}

.macro-btn small {
  font-size: 0.5rem;
  opacity: 0.8;
  margin-top: -1px;
}

.macro-btn:active, .macro-btn.pressed {
  background: var(--t3-gold);
  color: #000;
  transform: scale(0.92);
}

.btn-grab1 { border-color: #ff9900; color: #ffaa00; }
.btn-grab2 { border-color: #ffcc00; color: #ffd700; }
.btn-macro12 { border-color: #00e5ff; color: #66e5ff; }
.btn-macro34 { border-color: #ff3366; color: #ff6688; }

/* 4-Attack Button Diamond */
.attack-diamond {
  position: relative;
  width: 175px;
  height: 165px;
}

.action-btn {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  border: 2px solid;
  background: rgba(22, 26, 36, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  touch-action: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  transition: transform 0.04s ease;
}

.action-btn small {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: -2px;
}

.action-btn:active, .action-btn.pressed {
  filter: brightness(1.7);
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.4);
}

.btn-square { top: 55px; left: 0; border-color: #ff3399; box-shadow: 0 0 12px rgba(255, 51, 153, 0.5); }
.btn-triangle { top: 0; left: 60px; border-color: #00ff88; box-shadow: 0 0 12px rgba(0, 255, 136, 0.5); }
.btn-cross { bottom: 0; left: 60px; border-color: #00d4ff; box-shadow: 0 0 12px rgba(0, 212, 255, 0.5); }
.btn-circle { top: 55px; right: 0; border-color: #ff3344; box-shadow: 0 0 12px rgba(255, 51, 68, 0.5); }

/* Menu buttons (Start / Select placed in top-left clear zone) */
.touch-menu {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  z-index: 100;
}

.touch-menu-btn {
  background: rgba(22, 26, 36, 0.75);
  border: 1px solid var(--t3-panel-border);
  color: var(--t3-gold);
  font-family: var(--t3-font-tech);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.touch-menu-btn:active, .touch-menu-btn.pressed {
  background: var(--t3-gold);
  color: #000;
}

/* ROTATE DEVICE OVERLAY (FOR PORTRAIT MOBILE) */
#rotate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 12, 16, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.rotate-card {
  background: rgba(31, 40, 51, 0.85);
  border: 1.5px solid var(--text-main);
  border-radius: 18px;
  padding: 32px 24px;
  max-width: 340px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.9), 0 0 20px rgba(102, 252, 241, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rotate-icon {
  width: 54px;
  height: 54px;
  border: 3px solid var(--text-main);
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: 0 0 15px rgba(102, 252, 241, 0.4);
  animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(90deg); }
  60% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: portrait) and (max-width: 900px) {
  #rotate-overlay {
    display: flex;
  }
}

body.dismiss-rotate #rotate-overlay {
  display: none !important;
}

/* KEY REMAPPING MODAL (Zero-Break Conflict Swapper) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 15px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: rgba(18, 25, 38, 0.95);
  border: 1px solid rgba(102, 252, 241, 0.4);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(102, 252, 241, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(31, 40, 51, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--text-main);
}

.modal-subtitle {
  padding: 10px 20px;
  font-size: 0.8rem;
  color: var(--text-sub);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.remap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 15px 20px;
  max-height: 55vh;
  overflow-y: auto;
}

.remap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.remap-action-name {
  color: #fff;
  font-weight: bold;
}

.remap-key-btn {
  background: rgba(102, 252, 241, 0.15);
  border: 1px solid rgba(102, 252, 241, 0.4);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: monospace;
  font-weight: bold;
  font-size: 0.85rem;
  min-width: 60px;
  text-align: center;
}

.remap-key-btn:hover {
  background: var(--text-main);
  color: #0b0c10;
}

.remap-key-btn.listening {
  background: #ffaa00;
  color: #000;
  border-color: #fff;
  animation: pulseListen 0.8s infinite alternate;
}

@keyframes pulseListen {
  from { transform: scale(1); box-shadow: 0 0 5px #ffaa00; }
  to { transform: scale(1.05); box-shadow: 0 0 15px #ffaa00; }
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(31, 40, 51, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer .btn {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* Arcade Loading & Lockstep Sync Overlay */
.arcade-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 12, 16, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  backdrop-filter: blur(8px);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.arcade-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-box {
  background: rgba(31, 40, 51, 0.85);
  border: 2px solid var(--t3-orange);
  box-shadow: 0 0 25px rgba(255, 85, 0, 0.4), inset 0 0 15px rgba(255, 85, 0, 0.2);
  border-radius: 12px;
  padding: 30px 40px;
  text-align: center;
  max-width: 90%;
  width: 440px;
}

.loader-icon-wrap {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 85, 0, 0.15);
  border-top-color: var(--t3-orange);
  border-right-color: var(--accent-cyan);
  border-radius: 50%;
  animation: arcadeSpin 1s linear infinite;
}

@keyframes arcadeSpin {
  to { transform: rotate(360deg); }
}

.loader-fire-kanji {
  font-size: 26px;
  font-weight: 900;
  color: var(--t3-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  animation: kanjiPulse 1.2s ease-in-out infinite alternate;
}

@keyframes kanjiPulse {
  from { transform: scale(0.95); opacity: 0.8; }
  to { transform: scale(1.05); opacity: 1; }
}

.loader-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 0 8px rgba(102, 252, 241, 0.5);
}

.loader-sub {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
  font-family: monospace;
  margin-bottom: 18px;
}

.loader-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--t3-orange), var(--t3-gold), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--t3-orange);
}

.loader-step {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: monospace;
  letter-spacing: 0.5px;
}


/* ==========================================================================
   ARCADE CABINET CATALOG (SCREEN 0 - HOME LANDING SCREEN)
   ========================================================================== */
.catalog-container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 10px 15px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.catalog-hero-bar {
  text-align: center;
  padding: 10px 10px 4px;
}

.catalog-headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.catalog-badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--t3-gold);
  background: rgba(249, 200, 14, 0.12);
  border: 1px solid rgba(249, 200, 14, 0.4);
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(249, 200, 14, 0.2);
}

.catalog-title {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(255, 85, 0, 0.6), 0 0 30px rgba(255, 85, 0, 0.3);
  margin: 0 0 4px;
}

.catalog-subline {
  font-size: 0.85rem;
  color: var(--t3-subtext);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Responsive Cabinet Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  width: 100%;
}

/* Individual Cabinet Card */
.cabinet-card {
  position: relative;
  background: rgba(18, 19, 25, 0.92);
  border: 2px solid var(--t3-panel-border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.cabinet-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent, #ff5500);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 24px var(--card-accent, #ff5500);
}

.cabinet-card:active {
  transform: translateY(-2px);
}

/* Poster Media Wrapper */
.card-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #050508;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.cabinet-card:hover .card-poster {
  transform: scale(1.06);
  filter: brightness(1.08);
}

.card-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(18, 19, 25, 0.4) 60%, rgba(18, 19, 25, 0.98) 100%);
  pointer-events: none;
}

/* Top Floating Badges */
.card-badges-top {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.tag-platform {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.tag-mode {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--t3-cyan);
  color: var(--t3-cyan);
}

/* Platform badge specific styles */
.psx-badge {
  border-color: #00d4ff;
  color: #00d4ff;
}

.sega-badge {
  border-color: #0088ff;
  color: #33aaff;
  background: rgba(0, 136, 255, 0.25);
}

.cps-badge, .tag-arcade {
  border-color: #ffd700;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.25);
}

.nes-badge {
  border-color: #ff3344;
  color: #ff5566;
  background: rgba(255, 51, 68, 0.2);
}

.card-kanji-watermark {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 1.5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 2px;
  z-index: 2;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Card Body Info */
.card-info {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--t3-gold);
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--t3-subtext);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.card-netplay-pill {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--t3-green);
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
}

.btn-card-enter {
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.25) 0%, rgba(217, 4, 41, 0.35) 100%);
  border: 1px solid var(--card-accent, #ff5500);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cabinet-card:hover .btn-card-enter {
  background: var(--card-accent, #ff5500);
  color: #000;
  box-shadow: 0 0 12px var(--card-accent, #ff5500);
}

/* Back Button in Lobby Screen */
.arcade-btn-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arcade-btn-back:hover {
  background: rgba(255, 85, 0, 0.2);
  border-color: var(--t3-orange);
  color: var(--t3-gold);
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.4);
}

/* Lobby Hero Banner with Poster */
.lobby-hero-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  padding: 16px 20px;
}

.lobby-hero-poster {
  width: 90px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 85, 0, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 85, 0, 0.3);
  flex-shrink: 0;
}

.lobby-hero-text {
  display: flex;
  flex-direction: column;
}

/* Street Fighter II Controls Preview */
.sf2-preview-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sf2-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf2-type-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--t3-gold);
  width: 65px;
  letter-spacing: 0.5px;
}

.sf2-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sf2-sym {
  font-size: 0.8rem;
  font-weight: 900;
  color: #fff;
}

/* Cadillacs and Dinosaurs Controls Preview */
.dino-preview-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.dino-btn-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dino-sym {
  font-size: 0.85rem;
  font-weight: 900;
  color: #00e5ff;
}

.dino-desc {
  font-size: 0.65rem;
  color: var(--t3-subtext);
  line-height: 1.2;
}

/* Street Fighter II Touch Layout */
.sf2-touch-cluster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sf2-touch-row {
  display: flex;
  gap: 8px;
}

.btn-sf2-lp, .btn-sf2-mp, .btn-sf2-hp {
  background: radial-gradient(circle, #ff5500 0%, #aa2200 100%) !important;
  border-color: #ff5500 !important;
}

.btn-sf2-lk, .btn-sf2-mk, .btn-sf2-hk {
  background: radial-gradient(circle, #00d4ff 0%, #0055aa 100%) !important;
  border-color: #00d4ff !important;
}

/* Cadillacs Touch Layout */
.dino-touch-cluster {
  display: flex;
  gap: 12px;
  align-items: center;
}


/* ==========================================================================
   SLEEK FAST SEARCH ENGINE & CATEGORY FILTERS
   ========================================================================== */
.arcade-search-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 8px;
}

/* Minimalist Search Capsule */
.search-capsule {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(14, 16, 22, 0.9);
  border: 1.5px solid rgba(255, 85, 0, 0.32);
  border-radius: 28px;
  padding: 4px 14px 4px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.search-capsule:focus-within {
  border-color: var(--t3-cyan);
  background: rgba(16, 20, 28, 0.98);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: var(--t3-orange);
  user-select: none;
  pointer-events: none;
}

.search-icon-svg {
  width: 16px;
  height: 16px;
  stroke: var(--t3-orange);
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.search-capsule:focus-within .search-icon-svg {
  stroke: var(--t3-cyan);
  transform: scale(1.1);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--t3-font-tech);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  padding: 6px 4px;
}

.search-input::placeholder {
  color: var(--t3-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}

.search-capsule:focus-within .search-input::placeholder {
  color: rgba(160, 163, 181, 0.5);
}

/* Match Count Badge */
.search-count-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--t3-gold);
  background: rgba(249, 200, 14, 0.12);
  border: 1px solid rgba(249, 200, 14, 0.3);
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: 6px;
  user-select: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* Clear Button */
.btn-search-clear {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.15s ease;
}

.btn-search-clear:hover {
  background: rgba(255, 51, 68, 0.8);
  transform: scale(1.1);
}

.btn-clear-svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
}

/* Keyboard / Hotkey Hint */
.search-kbd-hint {
  display: flex;
  align-items: center;
  user-select: none;
  pointer-events: none;
}

.search-kbd-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-width: 2px;
  color: var(--t3-subtext);
  font-family: monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Filter Pills Row */
.filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(18, 19, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--t3-subtext);
  font-family: var(--t3-font-tech);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0.2, 1);
  user-select: none;
  white-space: nowrap;
}

.filter-pill .pill-svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  flex-shrink: 0;
}

.filter-pill:hover {
  border-color: rgba(255, 85, 0, 0.5);
  color: #fff;
  transform: translateY(-1px);
  background: rgba(255, 85, 0, 0.12);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(255, 85, 0, 0.28) 0%, rgba(217, 4, 41, 0.32) 100%);
  border-color: var(--t3-orange);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.3);
}

/* Ultra-Compact Empty Search State (Horizontal Banner Style) */
.search-empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(22, 24, 34, 0.85);
  border: 1px solid rgba(255, 85, 0, 0.3);
  border-radius: 10px;
  width: 100%;
  max-width: 580px;
  margin: 8px auto 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: fadeInEmpty 0.2s ease-out;
}

.search-empty-state.hidden,
.btn-search-clear.hidden {
  display: none !important;
}

@keyframes fadeInEmpty {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 85, 0, 0.12);
  border: 1px solid rgba(255, 85, 0, 0.3);
  flex-shrink: 0;
}

.search-empty-state .empty-icon-svg {
  width: 18px;
  height: 18px;
  stroke: var(--t3-orange);
}

.search-empty-state .empty-text-wrap {
  flex: 1;
  text-align: left;
}

.search-empty-state .empty-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #fff;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.search-empty-state .empty-desc {
  font-size: 0.75rem;
  color: var(--t3-subtext);
  margin: 0;
}

.search-empty-state .empty-desc span {
  color: var(--t3-gold);
  font-weight: bold;
}

.btn-empty-reset {
  background: linear-gradient(135deg, #ff5500 0%, #d90429 100%);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: var(--t3-font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-empty-reset:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.5);
}

/* Cabinet Card Filter Animations */
.cabinet-card {
  transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.cabinet-card.filtered-out {
  display: none !important;
}

/* Catalog Compact Footer & Legal Disclaimer */
.catalog-footer {
  width: 100%;
  margin-top: 30px;
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--t3-muted);
}

.footer-title {
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--t3-subtext);
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--t3-cyan);
  font-size: 0.76rem;
  font-family: var(--t3-font-tech);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px 6px;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: #fff;
}

/* DMCA Modal */
.dmca-modal-card {
  max-width: 620px;
  background: rgba(16, 18, 25, 0.98);
  border: 1px solid var(--t3-cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.dmca-modal-body {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #c9ccd8;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 20px;
}

.dmca-modal-body p {
  margin: 0;
}

.dmca-modal-body strong {
  color: #fff;
}

.dmca-email {
  color: var(--t3-gold);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Mobile Adjustments for Search */
@media (max-width: 600px) {
  .search-capsule {
    padding: 4px 12px 4px 14px;
  }
  .search-input {
    font-size: 0.85rem;
  }
  .search-kbd-hint {
    display: none;
  }
  .filter-pills-row {
    gap: 6px;
  }
  .filter-pill {
    font-size: 0.65rem;
    padding: 5px 10px;
  }
}
