:root {
  --bg-dark: #e8e6e1;
  --card-bg: #14161d;
  --accent-orange: #ffa500;
  --accent-yellow: #ffb405;
  --matrix-green: #00ff66;
  --text-light: #f0effc;
  --text-muted: #8a8e99;
  --font-heading: "Montserrat", sans-serif;
  --font-title: "Libre Caslon Display", serif;
  --font-mono: "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.page-loaded {
  opacity: 1;
}

body.page-leaving {
  opacity: 0;
}

.sports-wrapper {
  position: relative;
  width: 1800px;
  max-width: 95vw;
  margin: 0 auto;
}

.wrapper {
  width: 100%;
  position: relative;
  transition: all 0.5s ease;
}

.header-tag {
  font-family: var(--font-mono);
  color: #c11111;
  letter-spacing: 3px;
  font-size: 1rem;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ==========================================================================
   ACTION BOARD DESKTOP
   ========================================================================== */
.action-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  height: 500px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.wrapper.strip-active .action-grid {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  height: 0;
  overflow: hidden;
}

.action-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
}

.action-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-orange);
}

.action-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(80%) brightness(0.6);
  transition: filter 0.6s ease, transform 0.8s ease;
}

.action-card:hover img {
  filter: grayscale(0%) brightness(0.9);
  transform: scale(1.1);
}

.action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0) 80%);
  opacity: 0.3;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.action-card:hover::before {
  opacity: 1;
}

.action-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 3;
}

.action-card:hover::after {
  transform: scaleX(1);
}

.card-info {
  position: absolute;
  bottom: 30px;
  left: 25px;
  right: 25px;
  z-index: 2;
}

.card-category {
  font-family: var(--font-mono);
  color: var(--accent-orange);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2rem;
  color: #fff;
  margin-top: 5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* NEUMORPHIC KREIS-BUTTON DESKTOP */
.back-btn-circle {
  display: flex;
  position: absolute;
  bottom: -80px;
  left: 0px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #bbbab6;
  border: 1px solid #908f8c;
  cursor: pointer;
  z-index: 30;
  align-items: center;
  justify-content: center;
  box-shadow: 6px 6px 12px #8d8c89, -6px -6px 12px #d3cfcfcc;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-btn-circle .arrow {
  font-size: 1.8rem;
  color: #666c7a;
  transition: transform 0.3s ease, color 0.3s ease;
  line-height: 1;
}

/* ==========================================================================
   FILMSTREIFEN SLIDE-IN DESKTOP
   ========================================================================== */
.filmstrip-container {
  display: none;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  background: #111317;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wrapper.strip-active .filmstrip-container {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.strip-title-box h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: #fff;
  font-weight: 400;
}

.strip-title-box span {
  font-family: var(--font-mono);
  color: var(--accent-orange);
  font-size: 0.8rem;
  letter-spacing: 2px;
}

.back-to-board-btn {
  background: transparent;
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  font-family: var(--font-heading);
  padding: 10px 20px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.strip-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-behavior: smooth;
}

.strip-item {
  position: relative;
  flex: 0 0 320px;
  height: 380px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #181a20;
}

.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.7);
  transition: filter 0.8s ease, transform 1.8s cubic-bezier(0.25, 1, 0.4, 1);
}

/* ==========================================================================
   MODAL DESKTOP
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.95);
  backdrop-filter: blur(15px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.trading-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 1100px;
  height: auto;
  min-height: 420px;
  max-height: 88vh;
  border-radius: 16px;
  border: 2px solid var(--accent-orange);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  z-index: 10;
}

.trading-media {
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
}

.trading-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trading-content {
  padding: 45px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.stats-badge {
  padding: 5px 12px;
  background: rgba(255, 165, 0, 0.15);
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border-radius: 4px;
}

.gps-badge {
  padding: 5px 12px;
  background: rgba(0, 255, 102, 0.2);
  color: var(--matrix-green);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border-radius: 4px;
}

.trading-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 16px;
}

.trading-desc {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

/* ==========================================================================
   MOBIL-ANPASSUNG FÜR SPORTS & PERFORMANCE (STRIKT ABGETRENNT)
   ========================================================================== */
@media (max-width: 900px) {
  body {
    padding: 10px;
    min-height: auto;
  }

  .sports-wrapper {
    width: 100%;
    max-width: 100%;
    padding-bottom: 60px;
  }

  /* 1. HAUPTKARTEN STAPELN */
  .action-grid {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    gap: 15px !important;
  }

  .action-card {
    width: 100% !important;
    height: 180px !important;
    min-height: 180px !important;
    border-radius: 12px !important;
    clip-path: none !important;
    overflow: hidden !important;
    position: relative !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .action-card::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%) !important;
    opacity: 1 !important;
    z-index: 1 !important;
  }

  .action-card img {
    filter: grayscale(10%) brightness(0.85) !important;
  }

  .card-info {
    bottom: 20px !important;
    left: 20px !important;
    z-index: 2 !important;
  }

  .card-title {
    font-size: 1.5rem !important;
  }

  .back-btn-circle {
    display: none !important;
  }

  /* 2. GALERIE SLIDE-IN (VOLLBILD OVERLAY) */
  .wrapper.strip-active .filmstrip-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    z-index: 999 !important;
    padding: 15px 15px 30px 15px !important;
    overflow-y: auto !important;
    background: #111317 !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  .strip-header {
    position: sticky !important;
    top: 0 !important;
    background-color: #111317 !important;
    z-index: 100 !important;
    padding: 15px 50px 12px 0 !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: block !important;
  }

  .strip-title-box h2 {
    font-size: 1.4rem !important;
  }

  .back-to-board-btn {
    position: absolute !important;
    top: 12px !important;
    right: 10px !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    font-size: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .back-to-board-btn::after {
    content: "×" !important;
    font-size: 2rem !important;
    color: var(--accent-orange) !important;
    line-height: 1 !important;
  }

  .strip-track {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    overflow-x: visible !important;
    padding-bottom: 40px !important;
  }

  /* 3. TRADING CARD MODAL (GROSS & BADGES UNTEREINANDER) */
  .modal-overlay {
    padding: 60px 10px 10px 10px !important;
    background: rgba(5, 6, 8, 0.96) !important;
    align-items: flex-start !important;
  }

  .trading-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: calc(100vh - 75px) !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
    position: relative !important;
  }

  .trading-card::before {
    display: none !important;
  }

  .trading-media {
    width: 100% !important;
    height: 300px !important;
    min-height: 300px !important;
    flex-shrink: 0 !important;
  }

  .trading-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .trading-content {
    width: 100% !important;
    padding: 20px !important;
  }

  /* BADGES UNTEREINANDER ANORDNEN (OHNE UMBRUCH IN DEN PILLEN) */
  .badge-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  .stats-badge,
  .gps-badge {
    white-space: nowrap !important; /* Verhindert Text-Zeilenumbrüche in der Pille */
    display: inline-block !important;
  }

  .trading-title {
    font-size: 1.7rem !important;
  }

  /* SCHLIESSEN-X FREI OBEN RECHTS */
  .modal-close-btn {
    position: fixed !important;
    top: 10px !important;
    right: 12px !important;
    z-index: 1050 !important;
    background: #111317 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 2rem !important;
    color: var(--accent-orange) !important;
    border: 1px solid rgba(255, 165, 0, 0.4) !important;
  }
}
