/**
 * MOSTLY MOVIES PLATFORM - UNIVERSAL NAVIGATION & GAME SWITCHER
 */

.mm-global-nav {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(9, 9, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--mm-border-hairline);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  font-family: var(--mm-font-sans);
  box-sizing: border-box;
}

.mm-global-nav * {
  box-sizing: border-box;
}

.mm-nav-left {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.mm-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--mm-text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: opacity var(--mm-transition-fast);
}

.mm-nav-brand:hover {
  opacity: 0.85;
}

.mm-nav-brand .brand-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.mm-nav-brand .brand-tag {
  color: var(--mm-accent-gold);
}

.mm-game-switcher {
  position: relative;
  display: inline-block;
}

.mm-global-nav button {
  min-height: 0;
  height: auto;
  margin: 0;
  box-shadow: none;
  text-shadow: none;
  transform: none;
  letter-spacing: normal;
}

.mm-switcher-btn,
.mm-global-nav .mm-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--mm-bg-surface);
  color: var(--mm-text-primary);
  border: 1px solid var(--mm-border-subtle);
  border-radius: var(--mm-radius-pill);
  padding: 0.38rem 0.85rem;
  font-family: var(--mm-font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 0;
  height: auto;
  margin: 0;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
  transition: all var(--mm-transition-fast);
  white-space: nowrap;
}

.mm-switcher-btn:hover,
.mm-global-nav .mm-switcher-btn:hover {
  background: var(--mm-bg-elevated);
  border-color: var(--mm-border-medium);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transform: none;
}

.mm-switcher-btn:active,
.mm-global-nav .mm-switcher-btn:active {
  transform: none;
}

.mm-switcher-btn[aria-expanded="true"],
.mm-global-nav .mm-switcher-btn[aria-expanded="true"] {
  border-color: var(--mm-accent-gold);
  background: var(--mm-bg-elevated);
}

.mm-switcher-btn .switcher-current-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.mm-switcher-btn .switcher-current-icon .nav-game-svg,
.mm-switcher-btn .switcher-current-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* Active Game Accent Tint on Switcher Button */
.mm-switcher-btn[data-game="portal"] .switcher-current-icon { color: var(--mm-accent-gold); }
.mm-switcher-btn[data-game="cinedegrees"] .switcher-current-icon { color: var(--mm-accent-purple); }
.mm-switcher-btn[data-game="keyframe"] .switcher-current-icon { color: #ff5722; }
.mm-switcher-btn[data-game="plotlines"] .switcher-current-icon { color: var(--mm-accent-cyan); }
.mm-switcher-btn[data-game="cineclues"] .switcher-current-icon { color: #ffd700; }
.mm-switcher-btn[data-game="chronos"] .switcher-current-icon,
.mm-switcher-btn[data-game="cinechronos"] .switcher-current-icon { color: #10b981; }

.mm-switcher-btn .switcher-arrow {
  transition: transform var(--mm-transition-fast);
  color: var(--mm-text-muted);
}

.mm-switcher-btn[aria-expanded="true"] .switcher-arrow {
  transform: rotate(180deg);
  color: var(--mm-accent-gold);
}

.mm-switcher-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  background: var(--mm-bg-surface);
  border: 1px solid var(--mm-border-medium);
  border-radius: var(--mm-radius-md);
  min-width: 250px;
  max-width: calc(100vw - 2rem);
  padding: 0.5rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all var(--mm-transition-fast);
  z-index: 1000;
}

.mm-switcher-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mm-game-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--mm-radius-sm);
  color: var(--mm-text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all var(--mm-transition-fast);
}

.mm-game-option:hover {
  background: var(--mm-bg-elevated);
  color: var(--mm-text-primary);
}

.mm-game-option.is-current {
  background: rgba(229, 169, 59, 0.12);
  color: var(--mm-accent-gold);
  font-weight: 600;
}

.mm-game-option .mm-game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: all var(--mm-transition-fast);
}

.mm-game-option .mm-game-icon .nav-game-svg,
.mm-game-option .mm-game-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Dropdown Game-Specific Emblem Colors */
.mm-game-option[data-game="portal"] .mm-game-icon {
  background: rgba(229, 169, 59, 0.10);
  border-color: rgba(229, 169, 59, 0.22);
  color: var(--mm-accent-gold);
}
.mm-game-option[data-game="cinesnip"] .mm-game-icon,
.mm-game-option[data-game="cinecut"] .mm-game-icon {
  background: rgba(255, 42, 95, 0.10);
  border-color: rgba(255, 42, 95, 0.22);
  color: #ff2a5f;
}
.mm-game-option[data-game="cinedegrees"] .mm-game-icon {
  background: rgba(123, 97, 255, 0.10);
  border-color: rgba(123, 97, 255, 0.22);
  color: var(--mm-accent-purple);
}
.mm-game-option[data-game="keyframe"] .mm-game-icon {
  background: rgba(255, 77, 38, 0.10);
  border-color: rgba(255, 77, 38, 0.22);
  color: #ff5722;
}
.mm-game-option[data-game="plotlines"] .mm-game-icon {
  background: rgba(0, 242, 254, 0.10);
  border-color: rgba(0, 242, 254, 0.22);
  color: var(--mm-accent-cyan);
}
.mm-game-option[data-game="cineclues"] .mm-game-icon {
  background: rgba(255, 215, 0, 0.10);
  border-color: rgba(255, 215, 0, 0.22);
  color: #ffd700;
}
.mm-game-option[data-game="chronos"] .mm-game-icon,
.mm-game-option[data-game="cinechronos"] .mm-game-icon {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.22);
  color: #10b981;
}

.mm-game-option:hover .mm-game-icon {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.mm-game-option .mm-game-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mm-game-option .mm-game-name {
  font-weight: 600;
  color: var(--mm-text-primary);
}

.mm-game-option.is-current .mm-game-name {
  color: #ffffff;
}

.mm-game-option .mm-game-desc {
  font-size: 0.72rem;
  color: var(--mm-text-muted);
}

.mm-nav-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.mm-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--mm-border-hairline);
  padding: 0.35rem 0.75rem;
  border-radius: var(--mm-radius-pill);
  font-family: var(--mm-font-mono);
  font-size: 0.8rem;
  color: var(--mm-text-secondary);
  white-space: nowrap;
}

.mm-nav-badge strong {
  color: var(--mm-accent-gold);
}

.mm-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--mm-bg-surface);
  border: 1px solid var(--mm-border-subtle);
  color: var(--mm-text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--mm-radius-pill);
  font-family: var(--mm-font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--mm-transition-fast);
  white-space: nowrap;
}

.mm-nav-btn:hover {
  background: var(--mm-bg-elevated);
  color: var(--mm-text-primary);
  border-color: var(--mm-border-medium);
}

/* Language Switcher Pill */
.mm-lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--mm-bg-surface, #121218);
  border: 1px solid var(--mm-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--mm-radius-pill, 9999px);
  padding: 2px 5px 2px 7px;
  gap: 3px;
}

.mm-lang-globe {
  color: var(--mm-text-muted, #71717a);
  flex-shrink: 0;
  opacity: 0.85;
  transition: color var(--mm-transition-fast, 0.15s ease), opacity var(--mm-transition-fast, 0.15s ease);
}

.mm-lang-toggle:hover .mm-lang-globe {
  color: var(--mm-accent-gold, #e5a93b);
  opacity: 1;
}

.mm-lang-btn {
  background: transparent;
  border: none;
  color: var(--mm-text-muted, #71717a);
  font-family: var(--mm-font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--mm-transition-fast, 0.15s ease);
  line-height: 1;
}

.mm-lang-btn:hover {
  color: var(--mm-text-primary, #ffffff);
}

.mm-lang-btn.active {
  background: rgba(229, 169, 59, 0.18);
  color: var(--mm-accent-gold, #e5a93b);
  box-shadow: 0 0 10px rgba(229, 169, 59, 0.2);
}

.mm-lang-divider {
  color: var(--mm-border-subtle, rgba(255, 255, 255, 0.12));
  font-size: 0.72rem;
  user-select: none;
}

.mm-nav-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mm-font-mono);
  font-size: 0.8rem;
  color: var(--mm-text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.75rem;
  border-radius: var(--mm-radius-pill);
  border: 1px solid var(--mm-border-hairline);
  white-space: nowrap;
}

.mm-nav-timer svg {
  color: var(--mm-accent-gold);
  flex-shrink: 0;
}

.mm-nav-timer strong {
  color: var(--mm-accent-gold);
}

@media (max-width: 768px) {
  .mm-global-nav {
    padding: 0.55rem 1rem 0.5rem;
    gap: 0.65rem;
    flex-wrap: wrap;
    row-gap: 0;
  }
  .mm-nav-left {
    gap: 0.75rem;
    flex: 0 1 auto; /* do NOT grow — prevents nav-right from wrapping to row 2 */
  }
  .mm-nav-brand .brand-tag {
    display: none;
  }
  .mm-game-option .mm-game-desc {
    display: none;
  }
  .mm-switcher-dropdown {
    left: 0;
    right: auto;
    min-width: min(230px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }
  /* Streak badge: dedicated second row, full-width, centered */
  .mm-global-nav > .mm-streak-badge {
    order: 10;
    flex: 0 0 100%;
    justify-content: center;
    margin-top: 0.3rem;
    padding: 0.22rem 0.65rem;
    font-size: 0.76rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.4rem;
    border-radius: 0;
    background: transparent;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  /* nav-right (lang + timer) pushed to right of row 1 via auto margin */
  .mm-nav-right {
    flex: 0 0 auto;
    flex-shrink: 0;
    margin-left: auto;
  }
  /* Timer hides at tablet/narrow widths — lang selector has priority */
  .mm-nav-timer {
    display: none;
  }
}

@media (max-width: 580px) {
  .mm-global-nav {
    padding: 0.5rem 0.75rem 0.5rem;
  }
  .mm-nav-left {
    gap: 0.6rem;
    min-width: 0;
  }
  .mm-nav-brand .brand-text {
    display: none;
  }
  .mm-nav-timer {
    display: none;
  }
  .mm-switcher-dropdown {
    left: 0;
    right: auto;
    min-width: min(220px, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
  }
}

/* ==========================================================================
   UNIVERSAL CINEMA FOOTER (Platform Master)
   ========================================================================== */
footer.cinema-footer,
footer.game-footer,
#mm-global-footer {
  position: relative;
  z-index: 10;
  width: 100%;
  border-top: 1px solid var(--mm-border-hairline, rgba(255, 255, 255, 0.08));
  background: var(--mm-bg-black, #050507);
  padding: 3.5rem 2rem 4rem;
  font-size: 0.85rem;
  font-family: var(--mm-font-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  color: var(--mm-text-muted, #646476);
  margin-top: auto;
  box-sizing: border-box;
  display: block;
  text-align: left;
}

footer.cinema-footer .footer-inner,
footer.game-footer .footer-inner,
#mm-global-footer .footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

footer.cinema-footer .footer-left,
footer.game-footer .footer-left,
#mm-global-footer .footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

footer.cinema-footer .footer-brand,
footer.game-footer .footer-brand,
#mm-global-footer .footer-brand {
  font-weight: 700;
  color: var(--mm-text-primary, #f8f8fc);
  font-size: 1.1rem;
}

footer.cinema-footer .footer-brand a,
footer.game-footer .footer-brand a,
#mm-global-footer .footer-brand a {
  color: inherit;
  text-decoration: none;
  transition: color var(--mm-transition-fast, 0.2s ease);
}

footer.cinema-footer .footer-brand a:hover,
footer.game-footer .footer-brand a:hover,
#mm-global-footer .footer-brand a:hover {
  color: var(--mm-accent-gold, #e5a93b);
}

footer.cinema-footer .footer-left a,
footer.game-footer .footer-left a,
#mm-global-footer .footer-left a {
  color: var(--mm-text-secondary, #a2a2b4);
  text-decoration: none;
  transition: color var(--mm-transition-fast, 0.2s ease);
}

footer.cinema-footer .footer-left a:hover,
footer.game-footer .footer-left a:hover,
#mm-global-footer .footer-left a:hover {
  color: var(--mm-accent-gold, #e5a93b);
}

footer.cinema-footer .footer-links,
footer.game-footer .footer-links,
#mm-global-footer .footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

footer.cinema-footer .footer-links a,
footer.game-footer .footer-links a,
#mm-global-footer .footer-links a {
  color: var(--mm-text-secondary, #a2a2b4);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--mm-transition-fast, 0.2s ease);
}

footer.cinema-footer .footer-links a:hover,
footer.game-footer .footer-links a:hover,
#mm-global-footer .footer-links a:hover {
  color: var(--mm-text-primary, #ffffff);
}

@media (max-width: 768px) {
  footer.cinema-footer,
  footer.game-footer,
  #mm-global-footer {
    padding: 2.2rem 1.25rem 3rem;
  }

  footer.cinema-footer .footer-inner,
  footer.game-footer .footer-inner,
  #mm-global-footer .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  footer.cinema-footer .footer-links,
  footer.game-footer .footer-links,
  #mm-global-footer .footer-links {
    gap: 0.9rem 1.25rem;
  }
}
