/* ==========================================================================
   TheDubs Games — Matte Spiele-Bibliothek (Steam / GOG-Launcher-Stil)
   Offenes Breitbild-Layout, ruhige matte Schiefer-Töne, kein Neon, kein Slop.
   ========================================================================== */

:root {
  --bg: #14181f;
  --surface: #1b2028;
  --surface-raised: #222934;
  --surface-hover: #2a3240;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #e6ebf1;
  --text-dim: #9aa5b4;
  --text-faint: #6f7b8b;

  /* Matte Launcher-Akzente (Steam-Grün & ruhiges Stahlblau) */
  --play: #5c8a1f;
  --play-hover: #6da326;
  --steel: #3a6ea5;
  --steel-hover: #4880bc;
  --online: #4ade80;
  --offline: #ef4444;

  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Schlanke Launcher-Kopfzeile
   ========================================================================== */
.launcher-bar {
  background: #10141a;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.launcher-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}

.launcher-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.launcher-brand span.muted {
  color: var(--text-dim);
  font-weight: 400;
}

.launcher-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: var(--surface-raised);
  color: var(--text);
}

/* ==========================================================================
   Bibliothek-Regal (3 große Cover-Karten nebeneinander)
   ========================================================================== */
.shelf-section {
  padding: 24px 0 20px;
}

.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shelf-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cover-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.cover-card:hover {
  transform: translateY(-2px);
  background: var(--surface-raised);
  border-color: var(--line-strong);
}

.cover-card.active {
  border-color: var(--play-hover);
  background: var(--surface-raised);
}

.cover-art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d1015;
}

.cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cover-card:hover .cover-art img {
  transform: scale(1.03);
}

.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(20, 24, 31, 0.92) 100%);
}

.cover-status {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(16, 20, 26, 0.84);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.cover-footer {
  padding: 12px 14px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.cover-icon {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  background: #0e1218;
  flex-shrink: 0;
}

.cover-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.cover-genre {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
  flex-shrink: 0;
}

.dot.online { background: var(--online); }
.dot.offline { background: var(--offline); }

/* ==========================================================================
   Aktive Spiel-Detailansicht (Steam / GOG Hero-Banner + Aktionsleiste)
   ========================================================================== */
.detail-pane {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.detail-pane.active {
  display: block;
}

.hero-banner {
  position: relative;
  min-height: 290px;
  display: flex;
  align-items: flex-end;
  background-color: #0e1218;
  background-size: cover;
  background-position: center 35%;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 24, 31, 0.18) 0%,
    rgba(27, 32, 40, 0.65) 55%,
    #1b2028 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 28px 32px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-icon {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0d1015;
  flex-shrink: 0;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.hero-meta {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-meta .ver {
  font-family: var(--font-mono);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 12px;
}

/* Aktionsleiste direkt unter dem Banner (klassisches Steam-Layout) */
.action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 32px;
  background: #171c23;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.action-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

.btn-play {
  background: var(--play);
  color: #ffffff;
  padding: 10px 22px;
  font-size: 14px;
}

.btn-play:hover {
  background: var(--play-hover);
}

.btn-steel {
  background: var(--steel);
  color: #ffffff;
}

.btn-steel:hover {
  background: var(--steel-hover);
}

.btn-subtle {
  background: var(--surface-raised);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-subtle:hover {
  background: var(--surface-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.server-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  background: #11151b;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.server-copy code {
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 12px;
}

/* ==========================================================================
   Offener Detail-Inhalt (2 ruhige Spalten ohne verschachtelte Boxen)
   ========================================================================== */
.detail-body {
  padding: 26px 32px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 36px;
  align-items: start;
}

.block-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}

.game-blurb {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text);
  max-width: 68ch;
}

.key-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-dim);
}

.key-points li::before {
  content: "• ";
  color: var(--play-hover);
  font-weight: 700;
}

/* Screenshot-Filmstreifen */
.shot-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shot-btn {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0d1015;
  cursor: zoom-in;
  position: relative;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.shot-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.shot-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Rechte Spalte: Downloads & Rangliste (flach & aufgeräumt) */
.side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dl-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}

.dl-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dl-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dl-file {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-faint);
}

.dl-size {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
}

/* Schlichte Ranglisten-Tabelle */
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rank-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 6px 6px;
  border-bottom: 1px solid var(--line-strong);
}

.rank-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
}

.rank-table tr:last-child td {
  border-bottom: none;
}

.rank-table .num {
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.tag-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Eingebettete Live-Ansicht (volle Breite innerhalb der Detailansicht) */
.live-drawer {
  display: none;
  border-top: 1px solid var(--line-strong);
  background: #0d1015;
}

.live-drawer.open {
  display: block;
}

.live-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #12161c;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-dim);
}

.live-drawer iframe {
  width: 100%;
  height: 700px;
  border: 0;
  display: block;
}

/* ==========================================================================
   Kompakte Discord-Leiste am unteren Rand (aufklappbar)
   ========================================================================== */
.discord-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 28px;
  overflow: hidden;
}

.discord-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
}

.discord-drawer {
  display: none;
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  background: #14181f;
}

.discord-drawer.open {
  display: block;
}

.discord-drawer iframe {
  width: 100%;
  max-width: 460px;
  height: 380px;
  border: 0;
  border-radius: 4px;
  display: block;
}

/* ==========================================================================
   Footer, Lightbox & Toast
   ========================================================================== */
.launcher-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #10141a;
  padding: 16px 0;
  color: var(--text-faint);
  font-size: 12px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--text);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 12, 16, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox-img {
  max-height: 82vh;
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
}

.lightbox-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--play-hover);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .detail-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 780px) {
  .wrap {
    padding: 0 16px;
  }

  .shelf-grid {
    grid-template-columns: 1fr;
  }

  .hero-content,
  .action-strip,
  .detail-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .shot-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-drawer iframe {
    height: 520px;
  }
}
