/* ============================================================================
   BLADEWORKS BOTS // 4D HERO PHONE & TOUCH STYLESHEET (mobile-4d.css)
   JZ Ultra-Clean Full-Bleed Hero Phone Directive (t1u + t2u):
     1. Giant Commanding Hero Soldier in Full-Bleed 3D Hangar (Upper 62% of screen)
     2. Pure Suspended Translucent Hologram Projection in Air Below the Bot:
        - Line 1: Bot Name · Price (e.g. SECURITY BOT · $29)
        - Line 2: What It Does (e.g. Audits Connected Apps, 2FA & Account Permissions)
        - Followed by the single glowing cyan DEPLOY button
     3. Zero Clutter: No side text walls, no capability pill rows, no micro-text,
        no degree button bars, no customization dropdowns, no roster header bar
     4. Clean Horizontal Swipe Roster at Bottom with Zero Truncated Names
   Strict 4-Class Bladeworks Palette (0.0000% Warm Pixels):
     - Halo Cobalt         : #3B82F6 (rgb(59, 130, 246))
     - Tactical Emerald    : #10B981 (rgb(16, 185, 129))
     - Bladeworks Ice Cyan : #00E5FF (rgb(0, 229, 255))
     - Cortana Violet      : #8B5CF6 (rgb(139, 92, 246))
   ============================================================================ */

:root,
[data-theme="dark"],
.theme-dark {
  --m4d-cobalt: #3B82F6;
  --m4d-emerald: #10B981;
  --m4d-cyan: #00E5FF;
  --m4d-violet: #8B5CF6;

  --m4d-bg-void: #04070E;
  --m4d-bg-deep: #080D1A;
  --m4d-bg-slate: #0F172A;
  --m4d-text-bright: #F8FAFC;
  --m4d-text-primary: #E2E8F0;
  --m4d-text-muted: #94A3B8;

  --m4d-accent: #00E5FF;
  --m4d-accent-rgb: 0, 229, 255;
  --pod-rotation-deg: 0deg;
  --pod-pitch-deg: 0deg;
  --m4d-safe-top: env(safe-area-inset-top, 0px);
  --m4d-safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"],
.theme-light {
  --m4d-cobalt: #3B82F6;
  --m4d-emerald: #10B981;
  --m4d-cyan: #00E5FF;
  --m4d-violet: #8B5CF6;

  --m4d-bg-void: #F1F5F9;
  --m4d-bg-deep: #E2E8F0;
  --m4d-bg-slate: #FFFFFF;
  --m4d-text-bright: #0F172A;
  --m4d-text-primary: #1E293B;
  --m4d-text-muted: #475569;

  --m4d-accent: #3B82F6;
  --m4d-accent-rgb: 59, 130, 246;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  background: var(--m4d-bg-void);
  color: var(--m4d-text-bright);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  overflow: hidden;
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   FULL-BLEED HERO PHONE VIEWPORT (.m4d-phone-viewport)
   ============================================================================ */
.m4d-phone-viewport {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #04070E;
  padding-top: var(--m4d-safe-top);
  padding-bottom: calc(8px + var(--m4d-safe-bottom));
  overflow: hidden;
}

[data-theme="light"] .m4d-phone-viewport {
  background: linear-gradient(180deg, #E2E8F0 0%, #F1F5F9 62%, #FFFFFF 100%);
}

/* ----------------------------------------------------------------------------
   1. WHISPER-THIN FLOATING TOP HEADER BAR
   ---------------------------------------------------------------------------- */
.m4d-top-header {
  position: absolute;
  top: calc(10px + var(--m4d-safe-top));
  left: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(8, 13, 26, 0.54);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.24);
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0,
    100% 8px, 100% calc(100% - 8px),
    calc(100% - 8px) 100%, 8px 100%,
    0 calc(100% - 8px), 0 8px
  );
}

[data-theme="light"] .m4d-top-header {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.m4d-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--m4d-text-bright);
  text-decoration: none;
  white-space: nowrap;
}

.m4d-brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--m4d-cyan);
  box-shadow: 0 0 10px var(--m4d-cyan);
}

[data-theme="light"] .m4d-brand-dot {
  background: var(--m4d-cobalt);
  box-shadow: 0 0 8px var(--m4d-cobalt);
}

.m4d-header-pills {
  display: flex;
  align-items: center;
  gap: 5px;
}

.m4d-pill {
  padding: 5px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--m4d-text-primary);
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

[data-theme="light"] .m4d-pill {
  background: #F1F5F9;
  color: #1E293B;
  border-color: rgba(59, 130, 246, 0.35);
}

.m4d-pill.active,
.m4d-pill:hover {
  color: #F8FAFC;
  background: rgba(0, 229, 255, 0.20);
  border-color: var(--m4d-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

[data-theme="light"] .m4d-pill.active {
  color: #0F172A;
  background: rgba(0, 229, 255, 0.22);
  border-color: var(--m4d-cobalt);
}

/* ----------------------------------------------------------------------------
   2. MASSIVE FULL-BLEED HERO SOLDIER STAGE (UPPER 62% OF VIEWPORT)
   Commanding head-to-toe Hero Soldier hovering over the Octagonal Emitter
   ---------------------------------------------------------------------------- */
.m4d-hero-stage {
  position: relative;
  width: 100%;
  /* Bugfix 2026-10-24: hero starts BELOW the floating header (+ safe-area) so the
     bot's head is never hidden under the BLADEWORKS / ALL 22 / FREE / SUITES bar. */
  margin-top: var(--m4d-header-clear, calc(64px + var(--m4d-safe-top)));
  height: calc(62dvh - var(--m4d-header-clear, 64px) + 40px);
  min-height: 300px;
  max-height: 600px;
  flex: 1 1 auto;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  background: #04070E;
}

.m4d-hero-stage:active {
  cursor: grabbing;
}

/* Static room/background layer: NEVER transformed by the drag */
.m4d-hero-img,
.m4d-hero-spin-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Frame keeps the full bot (head to feet) inside the stage */
  object-position: 50% 0%;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.m4d-hero-img {
  z-index: 0;
  transform: none !important;
  transition: filter 0.22s ease;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 86%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 86%, rgba(0,0,0,0) 100%);
}

/* Haze hides the baked-in static bot while the spinning copy turns */
.m4d-hero-spin-haze,
.m4d-hero-spin-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.m4d-hero-spin-haze {
  z-index: 1;
  opacity: 0;
  backdrop-filter: blur(18px) brightness(0.55);
  -webkit-backdrop-filter: blur(18px) brightness(0.55);
  background: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.06), rgba(4, 7, 14, 0.35) 70%);
}

/* Bot-only foreground layer: the ONLY element the drag transforms */
.m4d-hero-spin-layer {
  z-index: 2;
  will-change: transform;
  backface-visibility: visible;
}

[data-theme="light"] .m4d-hero-img,
[data-theme="light"] .m4d-hero-spin-img {
  filter: brightness(1.16) contrast(1.06);
}

/* Volumetric Stasis Pod Mist & Concentric Emitter Rings at Bot's Feet */
.m4d-pod-emitter-glow {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 380px;
  height: 120px;
  pointer-events: none;
  z-index: 4;
}

.m4d-mist-canvas {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 360px;
  height: 110px;
  pointer-events: none;
  opacity: 0.88;
}

.m4d-emitter-rings-svg {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 380px;
  height: 84px;
  pointer-events: none;
}

/* ----------------------------------------------------------------------------
   3. PURE SUSPENDED TRANSLUCENT HOLOGRAM PROJECTION IN AIR BELOW THE BOT
   Angled chamfered holographic glass plane suspended over the emitter mist
   ONLY Bot Name · Price + What It Does + Single Sleek DEPLOY Button
   ---------------------------------------------------------------------------- */
.m4d-hologram-deck {
  position: relative;
  z-index: 18;
  margin: -54px 14px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.m4d-hologram-projection {
  /* Infoplate 2026-10-24: lettering only + thin light rim, very translucent fill */
  position: relative;
  width: 100%;
  padding: 10px 16px 11px;
  text-align: center;
  background: rgba(8, 13, 26, 0.12);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  box-shadow: none;
}

[data-theme="light"] .m4d-hologram-projection {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  box-shadow: none;
}

.m4d-holo-bot-title {
  position: relative;
  font-size: 1.52rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--m4d-text-bright);
  text-shadow: 0 1px 6px rgba(4, 7, 14, 0.85);
  line-height: 1.12;
}

[data-theme="light"] .m4d-holo-bot-title {
  color: #0F172A;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.85);
}

.m4d-holo-what-it-does {
  position: relative;
  margin-top: 4px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--m4d-cyan);
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-shadow: 0 1px 5px rgba(4, 7, 14, 0.85);
}

[data-theme="light"] .m4d-holo-what-it-does {
  color: #3B82F6;
  text-shadow: 0 1px 5px rgba(255, 255, 255, 0.85);
}

/* Single Sleek Glowing Cyan DEPLOY Button */
.m4d-holo-deploy-btn {
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  background: rgba(8, 13, 26, 0.12);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: #F8FAFC;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(4, 7, 14, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  box-shadow: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

[data-theme="light"] .m4d-holo-deploy-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #0F172A;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.85);
  border-color: rgba(59, 130, 246, 0.28);
}

.m4d-holo-deploy-btn:active {
  transform: scale(0.98);
}

/* ----------------------------------------------------------------------------
   4. CLEAN HORIZONTAL SWIPE ROSTER AT BOTTOM (ZERO TRUNCATED NAMES)
   ---------------------------------------------------------------------------- */
.m4d-bottom-roster {
  position: relative;
  z-index: 20;
  padding: 2px 0 4px;
}

.m4d-roster-track {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 14px;
  touch-action: pan-x;
  gap: 8px;
  padding: 2px 14px 4px;
  scrollbar-width: none;
}

.m4d-roster-track::-webkit-scrollbar {
  display: none;
}

.m4d-roster-card {
  flex: 0 0 126px;
  width: 126px;
  height: 142px;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  background: #080D1A;
  border: 1.5px solid rgba(148, 163, 184, 0.32);
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0,
    100% 8px, 100% calc(100% - 8px),
    calc(100% - 8px) 100%, 8px 100%,
    0 calc(100% - 8px), 0 8px
  );
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

[data-theme="light"] .m4d-roster-card {
  background: #FFFFFF;
  border-color: rgba(59, 130, 246, 0.42);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.m4d-roster-card.active {
  border-color: var(--m4d-cyan);
  border-width: 2px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
  transform: translateY(-2px);
}

.m4d-roster-card-img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  object-position: 50% 14%;
  display: block;
}

.m4d-roster-card-price {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.64rem;
  font-weight: 900;
  color: #F8FAFC;
  background: rgba(4, 7, 14, 0.86);
  border: 1px solid var(--m4d-cyan);
}

.m4d-roster-card-plate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 14, 0.94);
  border-top: 1.5px solid var(--m4d-cyan);
  text-align: center;
}

[data-theme="light"] .m4d-roster-card-plate {
  background: rgba(255, 255, 255, 0.96);
}

.m4d-roster-card-name {
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #F8FAFC;
  white-space: nowrap;
  line-height: 1;
}

[data-theme="light"] .m4d-roster-card-name {
  color: #0F172A;
}

/* ============================================================================
   RESPONSIVE OVERRIDES IF LOADED INSIDE DESKTOP/LEGACY DOM (.game-viewport)
   ============================================================================ */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .wall-hologram-wrap,
  .floating-loadout-hud .hud-slot,
  .pod-swing-bar,
  .diegetic-telemetry {
    display: none !important;
  }
}

/* Ringfix + steamfix 2026-10-24: rings removed entirely (dark + light);
   the steam/vapor stays but sits directly under the bot, over the hover pad,
   well above the info block. */
.m4d-emitter-rings-svg {
  display: none !important;
}

.m4d-pod-emitter-glow {
  top: 47%;
  bottom: auto;
  width: 240px;
  height: 90px;
  z-index: 3;
}

.m4d-mist-canvas {
  bottom: 0;
  width: 240px;
  height: 90px;
  opacity: 0.8;
}
