/* Halo Universal Game Runner Modal */
.halo-runner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: -webkit-fill-available;
  z-index: 2147483640;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: halo-runner-in 0.22s ease-out;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes halo-runner-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.halo-runner-shell {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: 90vh;
  max-height: 720px;
  background: rgba(13, 20, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Native Fullscreen Mode (Desktop, Android & iOS edge-to-edge) */
.halo-runner-overlay.is-fullscreen {
  padding: 0 !important;
  background: #000 !important;
}

.halo-runner-overlay.is-fullscreen .halo-runner-shell {
  max-width: 100vw !important;
  max-height: 100vh !important;
  height: 100vh !important;
  height: -webkit-fill-available !important;
  width: 100vw !important;
  border-radius: 0 !important;
  border: none !important;
}

/* Floating Ambient Glass HUD in Fullscreen (Auto-dims to not block gameplay) */
.halo-runner-overlay.is-fullscreen .halo-runner-header {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: auto;
  height: auto;
  padding: 6px 12px;
  background: rgba(10, 16, 28, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.halo-runner-overlay.is-fullscreen .halo-runner-header:hover,
.halo-runner-overlay.is-fullscreen .halo-runner-header:active,
.halo-runner-overlay.is-fullscreen .halo-runner-header.hud-active {
  opacity: 1;
  transform: translateY(0);
}

.halo-runner-overlay.is-fullscreen .runner-title-group {
  display: none;
}

.halo-runner-header {
  height: 52px;
  background: rgba(8, 14, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.runner-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.runner-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.runner-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.runner-author {
  font-size: 12px;
  color: #94a3b8;
}

.runner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.runner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s;
  touch-action: manipulation;
}

.runner-btn:hover {
  transform: translateY(-1px);
}

.runner-btn.gold {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.runner-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.runner-btn.close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 13px;
  padding: 5px 10px;
}

.halo-runner-stage {
  flex: 1;
  background: #000;
  position: relative;
  overflow: hidden;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
}

.runner-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  display: block;
  touch-action: none;
  pointer-events: auto;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  .halo-runner-overlay {
    padding: 0;
  }
  .halo-runner-shell {
    height: 100vh;
    height: -webkit-fill-available;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}

/* Community Game Cards in Catalog */
.halo-game-card.community-game {
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(14, 23, 42, 0.8);
}

.hgc-tag.community {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.hgc-fallback-badge {
  font-size: 32px;
  display: grid;
  place-items: center;
  height: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}
