/* ============================================================================
   MTing OS — Immersive Console Arcade & True Fullscreen Game Mode (`os-games.css`)
   - Desktop (macOS 27 Tahoe / Win11): Left Cartridge Deck + Right Ambilight Live Stage + Fullscreen Theatre
   - Mobile (iOS 26 / Android 16): OLED Poster Stream + 100% Zero-Border Edge-to-Edge Game Mode
   ============================================================================ */

/* ---------- 1. Global Fullscreen Game Mode Overrides (Mobile & Desktop Theatre) ---------- */
html[data-game-fullscreen="1"] #pocket-sheet .mob-sys-holder,
html[data-game-fullscreen="1"] #pulse-ios-wrap,
html[data-game-fullscreen="1"] #pocket-sheet .mob-edge-zone,
html[data-game-fullscreen="1"] #pocket-sheet .mob-gesture-zone {
  opacity: 0 !important;
  pointer-events: none !important;
}
html[data-game-fullscreen="1"] #pocket-sheet .mob-home-ind {
  opacity: 0.22 !important;
}

html[data-os="macos"] .os-window:has(.arc-console) {
  background: #0D0E12;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.56), inset 0 0.5px 0 rgba(255, 255, 255, 0.18);
}

/* ---------- 2. Desktop Split Live Arcade Console (`macOS` & `Windows`) ---------- */
.arc-console {
  display: grid;
  grid-template-columns: 396px 1fr;
  width: 100%;
  height: 100%;
  background: #0D0E12;
  color: #F5F5F7;
  overflow: hidden;
  user-select: none;
}
.arc-console.win {
  grid-template-columns: 388px 1fr;
  background: #121316;
}

/* Left Cartridge Deck */
.arc-deck {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(20, 21, 27, 0.92);
  border-right: 0.5px solid rgba(255, 255, 255, 0.10);
  z-index: 2;
}
.arc-deck-top {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.arc-deck-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.arc-deck-brand img {
  width: 20px;
  height: 20px;
}

.arc-filters {
  display: inline-flex;
  gap: 3px;
  padding: 2.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.arc-filter-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.arc-filter-btn:hover {
  color: #FFFFFF;
}
.arc-filter-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.arc-deck-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.arc-sec-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.52);
  letter-spacing: 0.3px;
  margin: 2px 2px 9px;
}
.arc-sec-label + .arc-sec-label,
.arc-origin-grid + .arc-sec-label {
  margin-top: 16px;
}

/* Poster Cartridge Cards (Desktop Deck) */
.arc-origin-grid,
.arc-lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.arc-card {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 3 / 4.05;
  background: #1A1C23;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.22s ease;
}
.arc-card.origin {
  aspect-ratio: 3 / 4.25;
}
.arc-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
}
.arc-card.active {
  border-color: #FF375F;
  box-shadow: 0 0 0 1px #FF375F, 0 12px 28px rgba(255, 55, 95, 0.28);
}
.arc-console.win .arc-card.active {
  border-color: #4CC2FF;
  box-shadow: 0 0 0 1px #4CC2FF, 0 12px 28px rgba(76, 194, 255, 0.24);
}

.arc-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  transition: transform 0.35s ease;
}
.arc-card:hover .arc-card-img {
  transform: scale(1.04);
}
.arc-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 9, 13, 0.22) 0%,
    rgba(8, 9, 13, 0.05) 38%,
    rgba(8, 9, 13, 0.76) 74%,
    rgba(8, 9, 13, 0.95) 100%
  );
}
.arc-card-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.arc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2.5px 7px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(20, 22, 28, 0.72);
  color: rgba(255, 255, 255, 0.90);
  border: 0.5px solid rgba(255, 255, 255, 0.20);
}
.arc-badge.star {
  background: linear-gradient(135deg, rgba(255, 55, 95, 0.90), rgba(255, 138, 76, 0.90));
  border-color: rgba(255, 255, 255, 0.35);
  color: #FFF;
}
.arc-live-dot {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.92);
  color: #041E0B;
}

.arc-card-bot {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
}
.arc-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.22;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arc-card-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.70);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Live Playable Ambilight Stage */
.arc-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #07080B;
  overflow: hidden;
}
.arc-ambilight {
  position: absolute;
  inset: -48px;
  background-image: var(--gm-poster);
  background-size: cover;
  background-position: center;
  filter: blur(54px) saturate(195%) brightness(0.42);
  opacity: 0.88;
  pointer-events: none;
  transition: background-image 0.35s ease;
}
.arc-ambilight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(7, 8, 12, 0.12), rgba(7, 8, 12, 0.80) 78%);
}

.arc-stage-bar {
  position: relative;
  z-index: 3;
  height: 48px;
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(10, 11, 15, 0.68), rgba(10, 11, 15, 0));
  flex-shrink: 0;
}
.arc-console.win .arc-stage-bar {
  padding-right: 0;
}
.arc-stage-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.arc-stage-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arc-stage-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.arc-ctrl-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 9px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(26, 28, 36, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #FFFFFF;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.arc-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.arc-ctrl-btn.primary {
  background: rgba(255, 255, 255, 0.92);
  color: #0B0C10;
  border-color: transparent;
  padding: 0 13px;
}
.arc-ctrl-btn.primary:hover {
  background: #FFFFFF;
}

.arc-stage-center {
  position: relative;
  z-index: 3;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 20px 12px;
  gap: 8px;
}

/* Bezel-less Handheld Console Viewport */
.arc-handheld {
  position: relative;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 390 / 844;
  border-radius: 22px;
  overflow: hidden;
  background: #000000;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.68),
    0 0 0 1.5px rgba(255, 255, 255, 0.16),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.10);
}
.arc-handheld iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

.arc-stage-hook {
  max-width: 460px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 3. Desktop Full-Viewport Darkroom Theatre (`#gm-theatre-overlay`) ---------- */
#gm-theatre-overlay {
  position: fixed;
  inset: 0;
  z-index: 26500;
  background: #050608;
  color: #FFFFFF;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#gm-theatre-overlay.open {
  display: flex;
}
#gm-theatre-overlay .arc-ambilight {
  filter: blur(72px) saturate(210%) brightness(0.38);
}
.gm-th-top {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.gm-th-title-pill,
.gm-th-bar {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(22, 24, 32, 0.76);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.gm-th-title-pill strong {
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 4px;
}
.gm-th-stage {
  position: relative;
  z-index: 3;
  height: min(90dvh, 880px);
  aspect-ratio: 390 / 844;
  border-radius: 26px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.82),
    0 0 0 1.5px rgba(255, 255, 255, 0.18);
}
.gm-th-stage iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ---------- 4. Mobile Immersive Poster Stream (`iOS 26` & `Android 16`) ---------- */
.gm-mob-lobby {
  position: relative;
  width: 100%;
  height: 100%;
  background: #07080C;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gm-mob-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: calc(var(--sys-top, 48px) + 10px) 16px calc(var(--sys-bottom, 24px) + 28px);
  scrollbar-width: none;
}
.gm-mob-scroll::-webkit-scrollbar {
  display: none;
}
.gm-mob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.gm-mob-head h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0;
}

/* Flagship Cinematic Spotlight Cards on Mobile */
.gm-mob-spotlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.gm-spot-card {
  position: relative;
  height: 214px;
  border-radius: 24px;
  overflow: hidden;
  background: #15171E;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.gm-spot-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 56%);
}
.gm-spot-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 7, 10, 0.16) 0%,
    rgba(6, 7, 10, 0.10) 35%,
    rgba(6, 7, 10, 0.82) 76%,
    rgba(6, 7, 10, 0.96) 100%
  );
}
.gm-spot-top {
  position: absolute;
  top: 12px;
  left: 12px;
}
.gm-spot-bot {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 13px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.gm-spot-info {
  min-width: 0;
  flex: 1;
}
.gm-spot-info b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.15;
}
.gm-spot-info p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gm-spot-play {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  background: #FFFFFF;
  color: #090A0E;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* 12 Prototype Vertical Poster Grid on Mobile */
.gm-mob-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.gm-mob-poster {
  position: relative;
  aspect-ratio: 3 / 4.15;
  border-radius: 20px;
  overflow: hidden;
  background: #161820;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.gm-mob-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 52%);
}
.gm-mob-poster-play {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 16, 22, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255, 255, 255, 0.24);
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 5. Mobile 100% True Edge-to-Edge Fullscreen Game Mode ---------- */
.gm-mob-fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  overflow: hidden;
  z-index: 50;
}
.gm-mob-full-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  display: block;
  background: #000;
}

/* Micro Auto-Dimming Game Mode Floating Pill */
.gm-mob-hud {
  position: absolute;
  top: 52px;
  right: 10px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(16, 18, 24, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
  color: #FFFFFF;
  opacity: 0.92;
  transition: opacity 0.45s ease, transform 0.2s ease;
}
.gm-mob-hud.dimmed {
  opacity: 0.36;
}
.gm-mob-hud:hover,
.gm-mob-hud:active {
  opacity: 1 !important;
}
.gm-hud-btn {
  border: none;
  background: transparent;
  color: #FFFFFF;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.gm-hud-sep {
  width: 0.5px;
  height: 13px;
  background: rgba(255, 255, 255, 0.24);
}
