/* ============================================================================
   RAILBAN ARCADE HUB — 23 MINIJUEGOS + MULTIJUGADOR ONLINE 1v1 (Liquid Glass)
   Crisp dark glass · Zero grain noise · Touch-optimized · Responsive
   ============================================================================ */

.rb-arcade-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 12px 48px;
}

.rb-arcade-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.rb-arcade-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.rb-arcade-mode-tab:hover {
  border-color: rgba(0, 242, 254, 0.45);
  color: #fff;
}
.rb-arcade-mode-tab.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(125, 95, 255, 0.22));
  border-color: rgba(0, 242, 254, 0.65);
  color: #fff;
  box-shadow: 0 6px 22px rgba(0, 242, 254, 0.2);
}

/* ── Lobby Filters & Search ── */
.rb-arcade-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(11, 16, 30, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 20px;
}
.rb-arcade-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rb-arcade-search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}
.rb-arcade-search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}
.rb-arcade-search {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 12px;
  background: rgba(5, 8, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 0.88rem;
  outline: none;
}
.rb-arcade-search:focus {
  border-color: rgba(0, 242, 254, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.14);
}
.rb-arcade-user-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.rb-arcade-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-weight: 700;
}
.rb-arcade-cat-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rb-arcade-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.rb-arcade-cat-btn:hover {
  background: rgba(0, 242, 254, 0.12);
  color: #fff;
}
.rb-arcade-cat-btn.active {
  background: rgba(0, 242, 254, 0.18);
  border-color: rgba(0, 242, 254, 0.55);
  color: #67e8f9;
}

/* ── Game Grid Cards ── */
.rb-arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}
.rb-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: rgba(12, 18, 34, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
}
.rb-game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 36px rgba(0, 242, 254, 0.14);
}
.rb-game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.rb-game-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rb-game-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.rb-game-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}
.rb-game-pill.mp {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}
.rb-game-fav-btn {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.16s ease, transform 0.16s ease;
}
.rb-game-fav-btn:hover,
.rb-game-fav-btn.active {
  color: #fbbf24;
  transform: scale(1.15);
}
.rb-game-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}
.rb-game-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.48;
  flex: 1;
}
.rb-game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.74rem;
  color: #94a3b8;
}
.rb-game-record {
  color: #67e8f9;
  font-weight: 700;
  font-family: monospace;
}

/* ── Active Game Stage & Unified Liquid Glass HUD ── */
.rb-stage-wrap {
  display: none;
  flex-direction: column;
  gap: 12px;
  border-radius: 22px;
  background: rgba(9, 13, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.28);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 16px;
}
.rb-stage-wrap.active {
  display: flex;
}
.rb-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.rb-hud-left,
.rb-hud-stats,
.rb-hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rb-hud-stat {
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(5, 8, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 78px;
  text-align: center;
}
.rb-hud-stat-lbl {
  font-size: 0.63rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rb-hud-stat-val {
  font-size: 0.96rem;
  font-weight: 800;
  font-family: monospace;
  color: #f8fafc;
}
.rb-hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.rb-hud-btn:hover {
  background: rgba(0, 242, 254, 0.16);
  border-color: rgba(0, 242, 254, 0.45);
  color: #fff;
}

/* ── Online 1v1 Multiplayer Bar inside Stage ── */
.rb-mp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-size: 0.8rem;
}
.rb-mp-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.rb-mp-input {
  width: 96px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(5, 8, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  outline: none;
}
.rb-mp-vs-strip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.14), rgba(15, 23, 42, 0.7), rgba(236, 72, 153, 0.14));
  border: 1px solid rgba(0, 242, 254, 0.35);
  font-size: 0.84rem;
  font-weight: 700;
}
.rb-mp-vs-strip.connected {
  display: flex;
}

/* ── Game Viewport & Canvas Container ── */
.rb-game-viewport {
  position: relative;
  min-height: 460px;
  border-radius: 16px;
  background: rgba(4, 7, 15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.rb-game-viewport canvas {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  touch-action: none;
}

/* ── Pause & Game Over Overlays ── */
.rb-stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(4, 7, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.rb-stage-overlay.open {
  display: flex;
}
.rb-gameover-card {
  width: min(500px, 100%);
  max-height: 92%;
  overflow-y: auto;
  padding: 24px 22px;
  border-radius: 18px;
  background: rgba(12, 18, 34, 0.96);
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rb-lb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  max-height: 210px;
  overflow-y: auto;
}
.rb-lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
}
.rb-lb-row img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Shared Touch Pad Helper ── */
.rb-touch-pad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.rb-touch-btn {
  min-width: 52px;
  min-height: 46px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.rb-touch-btn:active {
  background: rgba(0, 242, 254, 0.28);
  transform: scale(0.95);
}

@media (max-width: 720px) {
  .rb-game-viewport {
    min-height: 360px;
    padding: 8px;
  }
  .rb-hud-stat {
    min-width: 64px;
    padding: 3px 8px;
  }
  .rb-arcade-grid {
    grid-template-columns: 1fr;
  }
}
