/**
 * Midnight - System Stylesheet
 * Minimalist dark glass interface
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --sidebar-w: 240px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 46px;
  --bg-dark: #050811;
  --bg-surface: rgba(14, 18, 28, 0.72);
  --bg-surface-hover: rgba(24, 30, 46, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --accent-soft: rgba(56, 189, 248, 0.14);
  --text-main: #f8fafc;
  --text-muted: rgba(255, 255, 255, 0.58);
  --text-dim: rgba(255, 255, 255, 0.36);
  --radius-card: 14px;
  --radius-pill: 9999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  user-select: none;
}

input, button, textarea, select {
  font-family: var(--font-sans);
}

/* Background layer */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

#app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  overflow: hidden;
}

/* ==========================================================================
   CUSTOM FROSTED GLASS DROPDOWN (REPLACES ALL NATIVE SELECTS)
   ========================================================================== */

.glass-dropdown {
  position: relative;
  display: inline-block;
}

.glass-dropdown-trigger {
  height: 36px;
  padding: 0 14px;
  background: rgba(14, 18, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.glass-dropdown-trigger:hover {
  background: rgba(24, 30, 44, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
}

.glass-dropdown.open .glass-dropdown-trigger {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.glass-dropdown-trigger svg,
.glass-dropdown-trigger i {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.glass-dropdown-chevron {
  transition: transform 0.18s ease;
}

.glass-dropdown.open .glass-dropdown-chevron {
  transform: rotate(180deg);
}

.glass-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  max-height: 290px;
  overflow-y: auto;
  background: rgba(15, 18, 26, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.glass-dropdown-menu.align-left {
  left: 0;
  right: auto;
}

.glass-dropdown.open .glass-dropdown-menu {
  display: flex;
  animation: dropdownFade 0.14s ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.glass-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  font-family: var(--font-sans);
  transition: all 0.12s ease;
}

.glass-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.glass-dropdown-item.selected {
  color: #fff;
  font-weight: 600;
}

.glass-dropdown-item svg,
.glass-dropdown-item i {
  width: 14px;
  height: 14px;
  opacity: 0.75;
  flex-shrink: 0;
}

/* Multi-select Checkbox inside Glass Dropdown */
.glass-check-box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.glass-dropdown-item.selected .glass-check-box {
  background: #fff;
  border-color: #fff;
  color: #090e17;
}

/* ==========================================================================
   LEFT SIDEBAR
   ========================================================================== */

.midnight-sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  background: rgba(7, 10, 18, 0.76);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: width 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.midnight-sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

.sidebar-brand {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

.midnight-sidebar.collapsed .sidebar-brand-title {
  opacity: 0;
  pointer-events: none;
}

.sidebar-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 16px 10px;
  flex-shrink: 0;
}

.midnight-sidebar.collapsed .sidebar-shortcuts {
  grid-template-columns: 1fr;
  padding: 10px 8px;
  gap: 6px;
}

.sidebar-shortcut-btn {
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-shortcut-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.sidebar-shortcut-btn svg, .sidebar-shortcut-btn i {
  width: 16px;
  height: 16px;
}

.sidebar-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 16px;
  flex-shrink: 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.midnight-sidebar.collapsed .sidebar-section-header {
  justify-content: center;
  padding: 8px 0;
}

.midnight-sidebar.collapsed .sidebar-section-header span {
  display: none;
}

.sidebar-add-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-add-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-tabs-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 12px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-tab-indicator {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 34px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.15s;
  opacity: 0;
}

.midnight-sidebar.collapsed .sidebar-tab-indicator {
  left: 8px;
  right: 8px;
}

.sidebar-tab-item {
  position: relative;
  z-index: 2;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 10px;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.sidebar-tab-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-tab-item.active {
  color: #090e17;
  font-weight: 600;
}

.sidebar-tab-item.active:hover {
  background: transparent;
  color: #090e17;
}

/* Clean transparent icon inside tab - no grey/white box shading */
.sidebar-tab-icon-wrap {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-tab-item.active .sidebar-tab-icon-wrap {
  background: transparent !important;
  color: #090e17;
}

.sidebar-tab-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.sidebar-tab-favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-tab-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.midnight-sidebar.collapsed .sidebar-tab-title {
  display: none;
}

.sidebar-tab-close-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.sidebar-tab-item:hover .sidebar-tab-close-btn {
  display: flex;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-tab-item.active .sidebar-tab-close-btn {
  display: flex;
  color: rgba(0, 0, 0, 0.55);
}

.sidebar-tab-item.active .sidebar-tab-close-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}

.sidebar-tab-item:not(.active) .sidebar-tab-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.midnight-sidebar.collapsed .sidebar-tab-close-btn {
  display: none !important;
}

/* Docked Music Widget (Hidden when idle) */
.sidebar-music-widget {
  padding: 10px 12px;
  margin: 0 10px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-music-widget.active {
  display: flex;
}

.sidebar-music-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-music-art {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-music-meta {
  flex: 1;
  min-width: 0;
}

.sidebar-music-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-music-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Navigation Grid (8 Pages = 4 cols x 2 rows) */
.sidebar-bottom-nav {
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.midnight-sidebar.collapsed .sidebar-bottom-nav {
  grid-template-columns: 1fr;
  padding: 8px 6px;
  gap: 4px;
}

.sidebar-nav-btn {
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.sidebar-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-btn.active {
  color: var(--accent-color);
  background: var(--accent-soft);
  border-color: var(--accent-glow);
}

.sidebar-nav-btn svg, .sidebar-nav-btn i {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.sidebar-collapse-btn {
  height: 28px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--glass-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.midnight-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  z-index: 20;
  background: rgba(7, 10, 18, 0.62);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  transition: left 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

body.sidebar-collapsed .midnight-topbar {
  left: var(--sidebar-collapsed-w);
}

.topbar-history-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-icon-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-icon-btn svg, .topbar-icon-btn i {
  width: 15px;
  height: 15px;
}

.midnight-omnibar-wrap {
  position: static;
  transform: none;
  flex: 1;
  max-width: 560px;
  min-width: 0;
  margin: 0 12px;
}

.midnight-omnibar {
  width: 100%;
  height: 32px;
  background: rgba(12, 16, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  transition: all 0.16s ease;
}

.midnight-omnibar:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.midnight-omnibar:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.omnibar-search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.midnight-omnibar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-sans);
}

.midnight-omnibar input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.topbar-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   MAIN VIEWPORT
   ========================================================================== */

#app-workspace {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
}

.midnight-viewport {
  position: fixed;
  top: var(--topbar-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: left 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

body.sidebar-collapsed .midnight-viewport {
  left: var(--sidebar-collapsed-w);
}

.tab-view {
  display: none;
  width: 100%;
  min-height: 100%;
  animation: fadeIn 0.16s ease-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   1. HOME VIEW (ULTRA-MINIMALIST)
   ========================================================================== */

.home-stage {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 80px;
}

.home-brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  cursor: pointer;
}

.home-moon-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px var(--accent-glow));
}

.home-brand-title {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}

.home-search-form {
  width: min(560px, 90vw);
  margin-bottom: 20px;
}

.home-search-capsule {
  width: 100%;
  height: 48px;
  background: rgba(12, 16, 26, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.18s ease;
}

.home-search-capsule:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.home-search-capsule:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 12px 32px rgba(0, 0, 0, 0.55);
}

.home-search-capsule input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-sans);
}

.home-search-capsule input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.home-quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 580px;
}

.quick-link-pill {
  height: 30px;
  padding: 0 13px;
  background: rgba(12, 16, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.quick-link-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.quick-link-pill svg, .quick-link-pill i {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   2. GAMES PAGE (CLEAN BAR + 5-COL GRID)
   ========================================================================== */

.games-container {
  padding: 20px 28px 90px;
  max-width: 1380px;
  margin: 0 auto;
}

.games-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.games-mode-toggle {
  display: inline-flex;
  background: rgba(14, 18, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.games-mode-btn {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.games-mode-btn.active {
  background: #fff;
  color: #090e17;
}

.games-search-bar {
  flex: 1;
  min-width: 220px;
  height: 36px;
  background: rgba(14, 18, 28, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 9px;
  transition: border-color 0.15s;
}

.games-search-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.35);
}

.games-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-sans);
}

.games-search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.games-fav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(14, 18, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.games-fav-btn:hover,
.games-fav-btn.active {
  border-color: #f43f5e;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
}

.games-count-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.games-count-label strong {
  color: #fff;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.game-tile {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(16, 20, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s, box-shadow 0.18s;
}

.game-tile:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
}

.game-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 7, 14, 0.9) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.18s ease;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.game-tile:hover .game-tile-overlay {
  opacity: 1;
}

.game-tile-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
}

.catalog-load-more {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.catalog-load-more-btn {
  padding: 9px 22px;
  background: rgba(14, 18, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.catalog-load-more-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   3. AI ASSISTANT VIEW (SCREENSHOT 3 LAYOUT)
   ========================================================================== */

.ai-layout-container {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  width: 100%;
  overflow: hidden;
}

.ai-sidebar {
  width: 240px;
  background: rgba(6, 9, 16, 0.65);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex-shrink: 0;
}

.ai-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding: 0 4px 12px;
}

.ai-chat-search {
  height: 34px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  margin-bottom: 16px;
}

.ai-chat-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12.5px;
}

.ai-chats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.ai-new-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-new-btn:hover {
  color: #fff;
}

.ai-sidebar-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.12s;
}

.ai-chat-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.ai-chat-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 500;
}

.ai-sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-model-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.ai-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.ai-main-topbar {
  height: 44px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.ai-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-welcome-center {
  margin: auto;
  max-width: 620px;
  width: 100%;
  text-align: center;
}

.ai-welcome-center h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.ai-welcome-center p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.ai-starter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.ai-starter-card {
  padding: 14px 16px;
  background: rgba(14, 18, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-starter-card:hover {
  background: rgba(24, 30, 44, 0.88);
  border-color: rgba(255, 255, 255, 0.22);
}

.ai-starter-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-starter-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.ai-composer-wrap {
  padding: 14px 32px 24px;
}

.ai-composer-box {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-input-pill {
  flex: 1;
  height: 46px;
  background: #0d1017;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ai-input-pill:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ai-input-pill input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13.5px;
}

.ai-send-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #141926;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ai-send-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #050811;
}

.ai-msg-bubble {
  max-width: 760px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
}

.ai-msg-bubble.user {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #fff;
}

.ai-msg-bubble.assistant {
  align-self: flex-start;
  background: rgba(14, 18, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

/* ==========================================================================
   4. LINKGEN VIEW (SCREENSHOT 4 & 5 LAYOUT)
   ========================================================================== */

.linkgen-stage {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 36px 20px 80px;
}

.linkgen-card {
  width: min(560px, 94vw);
  background: rgba(12, 16, 24, 0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.linkgen-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.linkgen-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.linkgen-row-info {
  flex: 1;
}

.linkgen-row-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.linkgen-row-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.linkgen-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  height: 36px;
  padding: 0 4px;
}

.linkgen-stepper button {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.linkgen-stepper button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.linkgen-stepper span {
  min-width: 28px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

.linkgen-generate-btn {
  width: 100%;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.linkgen-generate-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.linkgen-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.linkgen-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  font-size: 13px;
  color: #fff;
}

.linkgen-copy-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.linkgen-copy-btn:hover {
  background: #fff;
  color: #090e17;
}

/* ==========================================================================
   5. SETTINGS VIEW
   ========================================================================== */

.settings-container {
  max-width: 660px;
  margin: 32px auto 100px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card {
  position: relative;
  z-index: 1;
  background: #0c0f17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px rgba(0, 0, 0, 0.45);
}

.settings-card.dropdown-host-open,
.settings-card:has(.glass-dropdown.open),
.linkgen-card.dropdown-host-open,
.linkgen-card:has(.glass-dropdown.open) {
  z-index: 300;
}

.settings-card-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.settings-row-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.settings-row-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-text-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #fff;
  padding: 7px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  width: 180px;
}

.settings-text-input:focus {
  border-color: var(--accent-color);
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 23px;
  flex-shrink: 0;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: 0.2s;
}

.toggle-track:before {
  position: absolute;
  content: "";
  height: 17px;
  width: 17px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.settings-toggle input:checked + .toggle-track {
  background-color: var(--accent-color);
}

.settings-toggle input:checked + .toggle-track:before {
  transform: translateX(19px);
}

.theme-dots-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.theme-color-dot:hover {
  transform: scale(1.15);
}

.theme-color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.favicons-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favicon-chip {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.favicon-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.favicon-chip.active {
  border-color: var(--accent-color);
  background: rgba(56, 189, 248, 0.14);
}

.favicon-chip img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.panic-badge {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  font-family: monospace;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
}

.settings-danger-btn {
  padding: 7px 14px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 8px;
  color: #f87171;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.settings-danger-btn:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #fff;
}

.credits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.credits-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.credit-name {
  font-weight: 600;
  color: #fff;
}

.credit-role {
  color: var(--text-muted);
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 6px;
}

.settings-footer a {
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}

/* ==========================================================================
   6. MOVIES & TV, MUSIC & VM SHELLS
   ========================================================================== */

.movies-cinema-shell {
  background: #000;
  min-height: 100%;
  padding-bottom: 80px;
}

.movies-floating-nav-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
}

.movies-floating-pill-nav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(12, 14, 20, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 3px;
  flex-shrink: 0;
}

.cinema-nav-btn {
  padding: 7px 14px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}

.cinema-nav-btn:hover {
  color: #fff;
}

.cinema-nav-btn.active {
  background: #fff;
  color: #090e17;
  font-weight: 600;
}

.cinema-inline-search {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(12, 14, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.cinema-inline-search:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.cinema-inline-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13.5px;
}

.cinema-inline-search input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.movies-hero {
  position: relative;
  height: clamp(280px, 46vh, 430px);
  margin: 0 28px 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 36px 40px;
}

.movies-hero-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.42) 55%, rgba(0, 0, 0, 0.15) 100%),
              linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
}

.hero-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.hero-maturity-badge,
.hero-genre-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

#hero-genres {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-desc {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  margin-bottom: 18px;
}

.hero-actions-row {
  display: flex;
  gap: 10px;
}

.cinema-btn-play {
  padding: 9px 22px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.cinema-btn-info {
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.movies-rows-container {
  padding: 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.movies-landscape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Music Shell */
.music-shell {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.music-sidebar {
  width: 210px;
  background: rgba(6, 9, 16, 0.55);
  border-right: 1px solid var(--glass-border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.sidebar-nav-item {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.sidebar-nav-item.active,
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.music-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 80px;
}

/* VM Page */
.vms-page {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  align-items: center;
  justify-content: center;
}

.vms-status {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.vms-status-art {
  width: 52px;
  height: 52px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vms-status-art svg {
  width: 48px;
  height: 48px;
  display: block;
}

.vms-status-name {
  font-size: 18px;
  font-weight: 600;
}

.vms-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.vms-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.vms-page-live {
  height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
}

.vms-toolbar {
  height: 42px;
  background: rgba(12, 16, 26, 0.9);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.vms-frame {
  flex: 1;
  width: 100%;
  border: none;
}

/* ==========================================================================
   FULL-BLEED PROXY BROWSER & PLAYER MODAL
   ========================================================================== */

.browser-stage {
  position: fixed;
  top: var(--topbar-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 10;
  display: none;
  background: #000;
  transition: left 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

body.sidebar-collapsed .browser-stage {
  left: var(--sidebar-collapsed-w);
}

.browser-stage.active {
  display: block;
}

.browser-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.midnight-player-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: none;
  flex-direction: column;
}

.midnight-player-modal.active {
  display: flex;
}

.player-modal-bar {
  height: 42px;
  background: rgba(10, 14, 22, 0.96);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.player-modal-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

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

.player-modal-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #000;
}


/* ==========================================================================
   MOVIES & YOUTUBE CAROUSELS & CARDS
   ========================================================================== */

.movies-rows-container {
  padding: 18px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.movies-row-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.movies-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.movies-row-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.015em;
}

.movies-row-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-arrow-btn,
.row-nav {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.carousel-arrow-btn:hover,
.row-nav:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.movies-carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 4px 0;
}

.movies-carousel-track::-webkit-scrollbar {
  display: none;
}

.movie-landscape-card {
  position: relative;
  flex: 0 0 240px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1018;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.movies-landscape-grid .movie-landscape-card {
  flex: none;
  width: 100%;
}

.movie-landscape-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.movie-landscape-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movie-landscape-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
}

.movie-landscape-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-landscape-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.yt-cinema-card {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  scroll-snap-align: start;
}

.yt-short-cinema-card {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  scroll-snap-align: start;
}

.yt-duration-badge,
.yt-short-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   MUSIC SECTIONS & CARDS
   ========================================================================== */

.music-section {
  margin-bottom: 28px;
}

.music-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.music-section .section-header h2,
.music-section .section-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.015em;
}

.row-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
}

.music-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.music-row::-webkit-scrollbar {
  display: none;
}

.music-row > div,
.music-card {
  flex: 0 0 164px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  position: relative;
}

.music-row > div:hover,
.music-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}

.card-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  margin-bottom: 9px;
  background: #0d111a;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-artist {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.card-play {
  position: absolute;
  right: 16px;
  bottom: 54px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #050811;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.16s ease;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.music-row > div:hover .card-play,
.music-card:hover .card-play {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   AI CHAT MESSAGES, THINKING & CODE BLOCKS
   ========================================================================== */

.ai-message-row {
  display: flex;
  width: 100%;
  max-width: 780px;
  margin: 0 auto 14px;
}

.ai-message-row.user-row {
  justify-content: flex-end;
}

.ai-message-row.assistant-row {
  justify-content: flex-start;
}

.ai-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #fff;
}

.ai-bubble.user-bubble {
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
}

.ai-bubble.assistant-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.ai-thinking-accordion {
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
}

.code-block-wrap {
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 6, 12, 0.9);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
}

.code-copy-btn,
.bubble-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 11.5px;
  cursor: pointer;
}

.code-copy-btn:hover,
.bubble-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.bubble-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ==========================================================================
   LINKGEN META & LEGAL MODAL (TERMS / PRIVACY)
   ========================================================================== */

.linkgen-result-meta {
  font-size: 11px;
  color: var(--accent-color);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.legal-modal-backdrop.open {
  display: flex;
}

.legal-modal-card {
  width: min(620px, 100%);
  max-height: 82vh;
  background: rgba(12, 15, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.legal-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.legal-modal-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.legal-modal-body strong {
  color: #fff;
}


/* ==========================================================================
   MUSIC ARTIST CARDS, SOLID SURFACES & SHINES
   ========================================================================== */

.artist-avatar-wrap {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 10px;
  background: #121722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.artist-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-genre {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  margin-top: 2px;
}

.ai-bubble.assistant-bubble {
  background: #0e121b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.linkgen-card {
  background: #0c0f17 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 50px rgba(0, 0, 0, 0.6) !important;
}

.game-tile,
.movie-landscape-card,
.music-row > div,
.music-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}


/* ==========================================================================
   ASYNC THEME, CLICKABILITY, ICON CENTERING & MUSIC CARD SIZE LOCK
   ========================================================================== */

.movies-hero-vignette,
.movie-landscape-overlay {
  pointer-events: none;
}

.hero-content,
.movie-landscape-card {
  pointer-events: auto;
}

.music-row > div,
.music-card,
.artist-card {
  width: 156px !important;
  min-width: 156px !important;
  max-width: 156px !important;
  flex: 0 0 156px !important;
  overflow: hidden;
  background: #0d111a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.card-art {
  width: 136px !important;
  height: 136px !important;
  max-width: 100% !important;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
}

.topbar-icon-btn,
.sidebar-shortcut-btn,
.sidebar-nav-btn,
.bubble-action-btn,
.code-copy-btn {
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.sidebar-tab-close-btn {
  background: transparent !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-moon-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.sidebar-brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: contain;
}

::selection {
  background: var(--accent-soft);
  color: #fff;
}


/* === ASYNC VISUAL POLISH & FIXES === */
body, button, input, select, textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Remove weird edge shine and make cards frosted */
.settings-card,
.linkgen-card,
.game-tile,
.movie-landscape-card,
.music-row > div,
.music-card,
.artist-card,
.ai-bubble.assistant-bubble,
.sidebar-shortcut-btn,
.ai-input-pill,
.ai-send-btn {
  background: rgba(14, 18, 28, 0.88) !important;
  backdrop-filter: blur(22px) !important;
  -webkit-backdrop-filter: blur(22px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
}

/* Game placeholder with Font Awesome gamepad */
.game-tile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 22, 34, 0.92);
  color: rgba(255, 255, 255, 0.45);
  font-size: 30px;
}

/* Music card overlap fix & clean rounded layout */
.music-card,
.artist-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 12px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  gap: 0 !important;
}

.card-art {
  width: 136px !important;
  height: 136px !important;
  overflow: hidden !important;
  position: relative !important;
  border-radius: 10px !important;
  margin-bottom: 10px !important;
  flex-shrink: 0 !important;
  background: rgba(16, 22, 34, 0.92);
}

.artist-card .card-art {
  border-radius: 50% !important;
}

.card-art img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.card-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #f8fafc !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  line-height: 1.3;
}

.card-artist {
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.6) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.row-nav svg {
  width: 15px;
  height: 15px;
}

.card-play svg {
  width: 14px;
  height: 14px;
}

/* Artist profile spacing & accurate listeners */
.spotify-artist-hero {
  padding: 36px 28px 28px !important;
  border-radius: 18px !important;
  overflow: hidden;
  margin-bottom: 24px !important;
}

.spotify-artist-listeners {
  margin-top: 8px !important;
  font-size: 13.5px !important;
  color: rgba(255, 255, 255, 0.78) !important;
}

.spotify-artist-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
}

.spotify-artist-actions {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  margin-bottom: 8px !important;
}

/* AI sidebar delete button (no white box) */
.ai-chat-delete-btn {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.5) !important;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.ai-chat-delete-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f87171 !important;
}

/* AI image attachment preview & drag-over */
.ai-input-pill.drag-over {
  border-color: var(--accent, #60a5fa) !important;
  background: rgba(22, 30, 48, 0.94) !important;
}

.ai-attached-preview {
  display: none;
  padding: 0 4px 8px;
  gap: 8px;
}

.ai-attached-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 10px;
  background: rgba(14, 18, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 12px;
}

.ai-attached-chip img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
}

.ai-attached-chip button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

/* Linkgen URL color (not dark blue) */
.linkgen-result-url {
  color: #f8fafc !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkgen-result-url:hover {
  color: var(--accent, #60a5fa) !important;
}

/* Center-align icons cleanly */
.icon-btn,
.topbar-icon-btn,
.sidebar-shortcut-btn,
.ai-input-icon-btn,
.ai-send-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}


/* === UNIFORM SHORTCUT ICONS, MOVIES CLICKABILITY & MUSIC CARD SPACING === */
.sidebar-shortcut-btn i,
.sidebar-shortcut-btn svg,
.quick-link-pill i,
.quick-link-pill svg {
  width: 16px !important;
  height: 16px !important;
  font-size: 15px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.movies-hero-vignette,
.movie-landscape-overlay {
  pointer-events: none !important;
}

.hero-content,
.movies-hero-actions,
.cinema-btn-play,
.cinema-btn-info {
  position: relative !important;
  z-index: 6 !important;
}

.cinema-btn-play,
.cinema-btn-info {
  cursor: pointer !important;
}

.music-card,
.artist-card {
  height: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

.card-art {
  width: 140px !important;
  height: 140px !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  position: relative !important;
  border-radius: 10px !important;
  margin-bottom: 10px !important;
  flex-shrink: 0 !important;
}

.card-title,
.card-artist {
  position: static !important;
  width: 100% !important;
  display: block !important;
  z-index: 2 !important;
}

.ai-chat-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.ai-chat-item-title {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.ai-chat-delete-btn {
  margin-left: auto !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}


/* === SOFTEN WEIRD OUTLINING & FOCUS BORDERS === */
*:focus,
*:focus-visible {
  outline: none !important;
}

.movies-hero,
.cinema-inline-search,
.movies-nav-pill,
.settings-card,
.linkgen-card,
.game-tile,
.movie-landscape-card,
.music-row > div,
.music-card,
.artist-card,
.ai-bubble.assistant-bubble,
.sidebar-shortcut-btn,
.ai-input-pill,
.ai-send-btn,
.home-search-capsule,
.quick-link-pill {
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  outline: none !important;
}

.movies-hero {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48) !important;
}


/* === MUSIC PLAY BUTTON REMOVAL, LYRICS ANIMATION & AI WELCOME SUGGESTIONS === */
.card-play {
  display: none !important;
}

.lrc-line {
  padding: 8px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transform: scale(0.97);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease, opacity 0.35s ease, background 0.35s ease;
}

.lrc-line:hover {
  color: rgba(255, 255, 255, 0.72);
}

.lrc-line.active {
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  transform: scale(1) !important;
  background: rgba(255, 255, 255, 0.06);
}

.normal-ai-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  gap: 20px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.welcome-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 680px;
}

.suggestion-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  background: rgba(14, 18, 28, 0.88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(248, 250, 252, 0.9) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease !important;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  background: rgba(24, 30, 46, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.ai-new-chat-btn,
#ai-new-chat-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  cursor: pointer !important;
}

.ai-new-chat-btn:hover,
#ai-new-chat-btn:hover {
  background: rgba(255, 255, 255, 0.13) !important;
}


/* === MOBILE & TABLET RESPONSIVE SUPPORT === */
.mobile-menu-btn,
.mobile-sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(2, 5, 13, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  body.mobile-sidebar-open .mobile-sidebar-backdrop {
    display: block;
  }

  .midnight-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px !important;
    z-index: 950 !important;
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  }

  body.mobile-sidebar-open .midnight-sidebar {
    transform: translateX(0);
  }

  .sidebar-collapse-btn {
    display: none !important;
  }

  #app-workspace {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .browser-stage,
  body.sidebar-collapsed .browser-stage {
    left: 0 !important;
  }

  .midnight-topbar {
    padding: 0 10px !important;
    gap: 8px !important;
  }

  .home-stage {
    padding: 20px 16px !important;
  }

  .home-brand-title {
    font-size: 36px !important;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important;
    gap: 10px !important;
    padding: 0 12px 24px !important;
  }

  .games-toolbar,
  .movies-topbar,
  .music-header {
    padding: 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .movies-hero {
    height: auto !important;
    min-height: 240px !important;
    margin: 0 12px 12px !important;
    padding: 20px !important;
  }

  .movies-rows-container,
  .music-content {
    padding: 0 12px 24px !important;
  }

  .music-row > div,
  .music-card,
  .artist-card {
    flex: 0 0 138px !important;
  }

  .card-art {
    width: 114px !important;
    height: 114px !important;
  }

  .ai-workspace {
    flex-direction: column !important;
  }

  .ai-sidebar {
    width: 100% !important;
    max-height: 150px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .settings-container,
  .linkgen-container {
    padding: 14px !important;
  }

  .settings-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
}

@media (max-width: 480px) {
  .topbar-history-controls button[title="Forward"] {
    display: none !important;
  }

  .hero-title {
    font-size: 24px !important;
  }

  .welcome-title {
    font-size: 22px !important;
  }
}


/* === ASYNC COMMUNITY CHAT & COSMETIC SHOP === */
.async-chat-root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ac-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ac-channels-pane {
  width: 220px;
  flex-shrink: 0;
  background: rgba(10, 14, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.ac-server-header,
.ac-feed-header,
.ac-members-header {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
  font-size: 14px;
  color: #f8fafc;
  flex-shrink: 0;
}

.ac-channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ac-cat-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.42);
  padding: 10px 8px 4px;
  letter-spacing: 0.06em;
}

.ac-channel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.ac-channel-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.ac-channel-btn.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.ac-hash {
  color: rgba(255, 255, 255, 0.42);
  font-weight: 700;
}

.ac-lock-ico {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.ac-user-bar {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 11, 18, 0.85);
}

.ac-me-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.ac-me-text {
  min-width: 0;
}

.ac-me-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-me-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  gap: 4px;
}

.ac-feed-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(8, 11, 19, 0.72);
}

.ac-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ac-topic {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
}

.ac-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ac-empty-feed {
  margin: auto;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13.5px;
}

.ac-msg-row {
  display: flex;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  position: relative;
}

.ac-msg-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ac-msg-body {
  flex: 1;
  min-width: 0;
}

.ac-reply-ref {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ac-msg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}

.ac-msg-author {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ac-role-tag,
.ac-badge-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ac-msg-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.ac-msg-text {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.92);
  word-break: break-word;
}

.ac-mention {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.14);
  padding: 0 4px;
  border-radius: 4px;
}

.ac-msg-media {
  margin-top: 8px;
  max-width: 320px;
  max-height: 240px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  cursor: pointer;
}

.ac-reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ac-react-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 12px;
  cursor: pointer;
}

.ac-react-pill.mine {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.16);
}

.ac-msg-actions {
  position: absolute;
  top: 4px;
  right: 8px;
  display: none;
  gap: 4px;
  background: rgba(14, 18, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 3px;
}

.ac-msg-row:hover .ac-msg-actions {
  display: flex;
}

.ac-msg-actions button,
.ac-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ac-msg-actions button:hover,
.ac-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.ac-composer-extras {
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ac-extra-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(14, 18, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  margin-bottom: 6px;
}

.ac-extra-chip button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.ac-emoji-bar {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(14, 18, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 8px;
}

.ac-emoji-bar button {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.ac-composer {
  margin: 0 16px 14px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(14, 18, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ac-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 14px;
  padding: 6px 4px;
}

.ac-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-color, #38bdf8);
  border: none;
  color: #050811;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ac-members-pane {
  width: 210px;
  flex-shrink: 0;
  background: rgba(10, 14, 24, 0.88);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.ac-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.ac-role-group-title {
  font-size: 11px;
  font-weight: 700;
  margin: 10px 4px 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ac-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.ac-member-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ac-member-name {
  font-size: 13px;
  font-weight: 500;
}

/* Avatar Frames */
.ac-avatar-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 2px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.ac-avatar-wrap.sm { width: 28px; height: 28px; }
.ac-avatar-wrap.lg { width: 64px; height: 64px; padding: 3px; margin: 0 auto 10px; }

.ac-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.ac-avatar-wrap.frame_aurora { background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc); }
.ac-avatar-wrap.frame_crimson { background: linear-gradient(135deg, #f87171, #fb923c); }
.ac-avatar-wrap.frame_gold { background: linear-gradient(135deg, #facc15, #f59e0b); }
.ac-avatar-wrap.frame_emerald { background: linear-gradient(135deg, #34d399, #06b6d4); }

/* Modals */
.ac-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(4, 7, 14, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ac-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(14, 18, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px;
}

.ac-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ac-modal-head button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  cursor: pointer;
}

.ac-modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ac-modal-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 13.5px;
}

.ac-primary-btn {
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--accent-color, #38bdf8);
  border: none;
  color: #050811;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.ac-primary-btn.sm { padding: 6px 10px; font-size: 12px; }
.ac-link-btn { background: transparent; border: none; color: rgba(255, 255, 255, 0.65); font-size: 12.5px; cursor: pointer; }
.ac-warn-btn { padding: 7px 10px; border-radius: 8px; background: rgba(250, 204, 21, 0.18); border: 1px solid rgba(250, 204, 21, 0.35); color: #facc15; cursor: pointer; font-size: 12px; }
.ac-danger-btn { padding: 7px 10px; border-radius: 8px; background: rgba(248, 113, 113, 0.18); border: 1px solid rgba(248, 113, 113, 0.35); color: #f87171; cursor: pointer; font-size: 12px; }

.ac-gif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.ac-gif-grid img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.ac-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ac-shop-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.ac-profile-card {
  text-align: center;
  padding: 8px 0 14px;
}

.ac-profile-sub,
.ac-profile-bio {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 6px;
}

.ac-profile-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 12.5px;
}

.ac-mod-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ac-mod-title { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; }
.ac-mod-row, .ac-mod-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .ac-members-pane { display: none; }
  .ac-channels-pane { width: 150px; }
}

#view-chat.active {
  display: flex !important;
  flex-direction: column;
  height: 100% !important;
  min-height: 0;
}

.ac-layout {
  flex: 1;
  height: 100%;
  min-height: 0;
}

.ac-add-channel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ac-add-channel-btn:hover { background: rgba(56, 189, 248, 0.22); }

.ac-shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ac-shop-tab {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ac-shop-tab.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #f8fafc;
}
.ac-shop-card.equipped {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

/* Bottom Music Player Bar */
.music-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(10, 14, 24, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.mpb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.mpb-left img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}
.mpb-meta { min-width: 0; }
.mpb-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpb-artist {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpb-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mpb-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mpb-btn:hover { background: rgba(255, 255, 255, 0.12); }
.mpb-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #38bdf8;
  color: #06101c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}
.mpb-right { display: flex; align-items: center; gap: 8px; }

/* Linkgen Filter Scanner */
.lg-scan-meta {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  margin: 10px 0 12px;
}
.lg-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.lg-scan-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(14, 18, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.lg-scan-card.clean { border-color: rgba(34, 197, 94, 0.3); }
.lg-scan-card.flagged { border-color: rgba(245, 158, 11, 0.4); }
.lg-scan-card.blocked { border-color: rgba(239, 68, 68, 0.45); }
.lg-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.lg-scan-name { font-size: 13px; font-weight: 600; color: #f8fafc; }
.lg-scan-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}
.lg-scan-badge.clean { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.lg-scan-badge.flagged { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.lg-scan-badge.blocked { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.lg-scan-detail { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); }

/* Custom Dark Select & Mod Panel in Async Chat */
.ac-select {
  position: relative;
  width: 100%;
}
.ac-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 13px;
  cursor: pointer;
}
.ac-select-trigger:hover { background: rgba(255, 255, 255, 0.08); }
.ac-select-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 190px;
  overflow-y: auto;
  padding: 4px;
  border-radius: 10px;
  background: rgba(12, 16, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.ac-select.open .ac-select-menu { display: flex; flex-direction: column; gap: 2px; }
.ac-select-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #e2e8f0;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.ac-select-opt:hover, .ac-select-opt.selected {
  background: rgba(56, 189, 248, 0.16);
  color: #f8fafc;
}
.ac-secondary-btn {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ac-secondary-btn:hover { background: rgba(255, 255, 255, 0.12); }
.ac-mod-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}
.ac-mod-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.ac-mod-empty { font-size: 12px; color: rgba(255, 255, 255, 0.45); padding: 4px 0; }
