/* ============================================================
   patmchugh launcher POC - Bootstrap 5 overrides + launcher UI
   Palette:
     #150503  outer shell (slightly darker than base)
     #280905  base surface
     #3a1108  raised surface
     #740A03  borders / muted accents
     #C3110C  primary accent (red)
     #E6501B  hot accent (vermillion)
     #f5e9e6  body text
   ============================================================ */

:root {
  --launcher-bg: #150503;
  --launcher-surface: #280905;
  --launcher-surface-2: #3a1108;
  --launcher-surface-3: #3a1108a3;
  --launcher-border: #740a03;
  --launcher-primary: #c3110c;
  --launcher-hot: #e6501b;
  --launcher-text: #f5e9e6;
  --launcher-text-muted: #b89994;
  --launcher-online: #2fd35a;

  /* Bootstrap variable overrides */
  --bs-body-bg: var(--launcher-bg);
  --bs-body-color: var(--launcher-text);
  --bs-body-font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-primary: var(--launcher-primary);
  --bs-primary-rgb: 195, 17, 12;
  --bs-border-color: var(--launcher-border);
  --bs-link-color: var(--launcher-hot);
  --bs-link-hover-color: #ff7846;
  --bs-secondary-color: var(--launcher-text-muted);
}

html,
body {
  min-height: 100%;
}

html {
  scrollbar-color: var(--launcher-border) var(--launcher-bg);
  scrollbar-width: thin;
}

body {
  background: radial-gradient(
      ellipse at top,
      rgba(116, 10, 3, 0.25) 0%,
      transparent 60%
    ),
    var(--launcher-bg);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Themed scrollbar (WebKit / Chromium / Edge) */
body::-webkit-scrollbar {
  width: 12px;
}

body::-webkit-scrollbar-track {
  background: var(--launcher-bg);
}

body::-webkit-scrollbar-thumb {
  background: var(--launcher-border);
  border-radius: 6px;
  border: 2px solid var(--launcher-bg);
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--launcher-hot);
}

/* ============================================================
   Launcher frame - the whole window
   ============================================================ */

.launcher-frame {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--launcher-bg);
}

/* ============================================================
   Wireframe placeholders (used everywhere instead of art)
   ============================================================ */

.wireframe {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--launcher-text-muted);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: rgba(58, 17, 8, 0.6);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(116, 10, 3, 0.25) 0,
    rgba(116, 10, 3, 0.25) 8px,
    transparent 8px,
    transparent 16px
  );
  border: 1px dashed var(--launcher-border);
  user-select: none;
  text-decoration: none;
}

.wireframe span {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  background: rgba(21, 5, 3, 0.65);
  border-radius: 2px;
  pointer-events: none;
}

.wireframe-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.wireframe-tile {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

/* ============================================================
   Title bar
   ============================================================ */

.titlebar {
  height: 48px;
  background: linear-gradient(180deg, #1d0604 0%, var(--launcher-surface) 100%);
  border-bottom: 1px solid var(--launcher-border);
  flex: 0 0 auto;
}

.titlebar-logo {
  width: 32px;
  height: 32px;
  font-size: 0.55rem;
}

.titlebar-account {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.titlebar-socials .social-icon {
  width: 26px;
  height: 26px;
  font-size: 0.5rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.titlebar-socials .social-icon:hover {
  border-color: var(--launcher-hot);
  color: var(--launcher-text);
}

.window-controls {
  gap: 2px;
}

.window-btn {
  width: 36px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--launcher-text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.window-btn:hover {
  background: rgba(116, 10, 3, 0.4);
  color: var(--launcher-text);
}

.window-btn-close:hover {
  background: var(--launcher-primary);
  color: #fff;
}

/* ============================================================
   Favorites bar
   ============================================================ */

.favorites-bar {
  justify-content: center;
  background: linear-gradient(
    180deg,
    var(--launcher-surface) 0%,
    rgba(40, 9, 5, 0.85) 100%
  );
  border: 1px solid var(--launcher-border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  flex: 0 0 auto;
  width: 100%;
}

.favorites-label {
  color: var(--launcher-text-muted);
  letter-spacing: 0.18em;
  font-size: 0.7rem;
}

.fav-tile {
  width: 50px;
  height: 50px;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.fav-tile:hover {
  transform: translateY(-2px);
}

.fav-tile.active {
  border-color: var(--launcher-hot);
  box-shadow: 0 0 12px rgba(230, 80, 27, 0.45);
}

.fav-tile .wireframe-tile {
  width: 100%;
  height: 100%;
}

.fav-tile-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.fav-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(116, 10, 3, 0.4);
  border: 1px solid var(--launcher-border);
  color: var(--launcher-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fav-add:hover {
  background: var(--launcher-primary);
  border-color: var(--launcher-hot);
  color: #fff;
}

/* ============================================================
   Centered column + full-viewport backdrop
   ============================================================ */

.launcher-centered {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.25rem 1rem 2rem;
}

.hero-bg {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  border: none;
  z-index: 0;
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg.has-wallpaper {
  background-color: transparent;
  background-image: none;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  border: none;
  color: transparent;
  transition: opacity 300ms ease-in-out;
}

.hero-bg.has-wallpaper > span {
  display: none;
}

.hero-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(
      ellipse 85% 70% at 50% 45%,
      rgba(21, 5, 3, 0.35) 0%,
      rgba(21, 5, 3, 0.75) 55%,
      rgba(10, 3, 2, 0.92) 100%
    ),
    linear-gradient(
      180deg,
      rgba(116, 10, 3, 0.12) 0%,
      transparent 40%,
      rgba(195, 17, 12, 0.15) 100%
    );
  z-index: 1;
  pointer-events: none;
}

.launcher-frame.has-wallpaper .hero-overlay {
  /* background: radial-gradient(
      ellipse 90% 75% at 50% 48%,
      rgba(21, 5, 3, 0.25) 0%,
      rgba(21, 5, 3, 0.65) 50%,
      rgba(10, 3, 2, 0.88) 100%
    ),
    linear-gradient(
      180deg,
      rgba(116, 10, 3, 0.08) 0%,
      transparent 45%,
      rgba(195, 17, 12, 0.12) 100%
    ); */
    background:none;
}

/* Game panel */

.hero-sidebar {
  position: relative;
  width: 100%;
  min-height: min(520px, 72vh);
  margin-top: 0;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--launcher-border);
  border-top: none;
  background: linear-gradient(
    165deg,
    #2a0d08 0%,
    var(--launcher-surface-3) 35%,
    #1a0806 100%
  );
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(245, 233, 230, 0.06);
}

.hero-sidebar::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(
    circle at 50% 38%,
    rgba(116, 10, 3, 0.22) 0%,
    transparent 42%
  );
  pointer-events: none;
  z-index: 0;
}

.hero-sidebar > * {
  position: relative;
  z-index: 1;
}

.game-logo {
  width: 100%;
  aspect-ratio: 2.5 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 300ms ease-in-out;
}

.game-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.quick-links li {
  margin-bottom: 0.35rem;
}

.quick-links a {
  color: var(--launcher-text);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.quick-links a:hover {
  color: var(--launcher-hot);
  border-bottom-color: var(--launcher-hot);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
}

.status-dot-online {
  background: var(--launcher-online);
  box-shadow: 0 0 8px rgba(47, 211, 90, 0.7);
}

.text-muted-subtle {
  color: var(--launcher-text-muted);
}

/* Environment selector */

.env-select {
  background-color: var(--launcher-surface);
  border: 1px solid var(--launcher-border);
  color: var(--launcher-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23E6501B'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

.env-select:focus {
  background-color: var(--launcher-surface);
  color: var(--launcher-text);
  border-color: var(--launcher-hot);
  box-shadow: 0 0 0 0.2rem rgba(230, 80, 27, 0.25);
}

.env-select option {
  background: var(--launcher-surface);
  color: var(--launcher-text);
}

.env-globe {
  width: 38px;
  height: 38px;
  background: var(--launcher-surface);
  border: 1px solid var(--launcher-border);
  border-radius: 6px;
  color: var(--launcher-text);
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}

.env-globe:hover {
  border-color: var(--launcher-hot);
}

/* Play button */

.play-btn {
  background: linear-gradient(
    180deg,
    var(--launcher-primary) 0%,
    #8a0c08 100%
  );
  color: #fff;
  border: 1px solid var(--launcher-hot);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0 14px rgba(195, 17, 12, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.play-btn:hover,
.play-btn:focus {
  color: #fff;
  filter: brightness(1.1);
  box-shadow: 0 0 22px rgba(230, 80, 27, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.play-btn:active {
  transform: translateY(1px);
}

.btn-gear {
  width: 48px;
  background: var(--launcher-surface);
  border: 1px solid var(--launcher-border);
  color: var(--launcher-text);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-gear:hover {
  border-color: var(--launcher-hot);
  color: var(--launcher-hot);
}

.gear-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.already-installed {
  color: var(--launcher-text-muted);
}

.already-installed a {
  color: var(--launcher-hot);
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.25rem;
}

.already-installed a:hover {
  text-decoration: underline;
}

/* ============================================================
   Responsive tweaks
   ============================================================ */

@media (max-width: 991.98px) {
  .titlebar-socials {
    display: none !important;
  }
}
