@font-face {
  font-family: 'Montserrat';
  src: url('../images/font/Montserrat-VariableFont_wght.ttf') format('truetype');
}

:root {
  --text: #f7f7f7;
  --background: #101828;
  --primary: #3b5fe2;
  --secondary: #f7f3f2;
  --accent: #c0d3d8;
  --font: 'Montserrat', sans-serif;
  --shadow: 2px 2px 20px 1px rgba(0,0,0,.1);
  --spacing: 0.25rem;
}

* {
  box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    min-height: 100vh;
    background-color: var(--background);
    font-family: var(--font);
}

/* Buttons don't inherit the font by default; without this, buttons that don't
   set it themselves (e.g. "Apply filters") fall back to the system font. */
button {
  font-family: inherit;
}

body {
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}
h1 {
  font-size: 3em;
  letter-spacing: -1px;
}
h2 {
  font-size: 2.5em;
  letter-spacing: -2px;
}
h3 {
  font-size: 2em;
}
h4 {
  font-size: 1.5em;
}
h5 {
  font-size: 1em;
}
h6 {
  font-size: 0.7em;
}
p {
  font-size: 1.1em;
  line-height: 150%;
}

.dropdown-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.dropdown {
  min-width: 10em;
  position: relative;
  margin: 2em;
}

#map-dd {
  z-index: 21;
}

#side-dd {
  z-index: 20;
}

.select {
  background: #18202b;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px rgb(33, 61, 107) solid;
  border-radius: 0.5em;
  padding: 1em;
  width: 12em;
  cursor: pointer;
  transition: background 0.3s;
}

/**********************
  * CLICKED STYLES *
***********************/

.select-clicked {
  border: 2px #26489a solid;
  box-shadow: 0 0 0.8em #26489a;
}

.select:hover {
  background: rgb(33, 61, 107);
}

.caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #fff;
  transition: 0.3s;
}

.menu {
  list-style: none;
  padding: 0.2em 0.5em;
  background: #18202b;
  border: 1px rgb(33, 61, 107) solid;
  box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.2);
  border-radius: 0.5em;
  color: var(--text);
  position: absolute;
  top: 2.7em;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  opacity: 0;
  display: none;
  transition: 0.2s;
}

.menu li {
  padding: 1em 0.5em;
  margin: 0.05em 0;
  border-radius: 0.5em;
  cursor: pointer;
}

.menu li:hover {
  background: rgb(33, 61, 107);
  transition: 0.1s;
}

/**********************
  * ACTIVE STYLES *
***********************/

.active {
  background: #26489a;
  /* border: 2px solid #26489a; */
}

/**********************
  * OPEN STYLES *
***********************/

.menu-open {
  display: block;
  opacity: 1;
}

nav {
    background-color: var(--background);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 10vw;
    height: calc(var(--spacing)*16);
    z-index: 31;
    border-bottom: 1px solid #1e2939;
  }
  .nav-left {
    display: flex;
    align-items: center;
    margin-left: 1em;
  }
  .nav-left h1 {
    font-size: 2em;
    margin: 0.7em 0.5em 0.7em 0.5em;
    color: var(--text)
  }
  .nav-main {
    display: flex;
  }

  .nav-main ul {
    background-color: inherit;
    color: var(--text);
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
  }

  .nav-left h1 a {
    text-decoration: none;
    color: white;
  }

  .nav-left .nav-logo img {
    height: 2.5em;
    width: auto;
    display: block;
    padding: 10px 0;
  }

  .nav-main li a {
    text-decoration: none;
    color: white;
    padding: 1em;
    display: inline-block;
    margin-right: 1em;
    position: relative;
    transition: transform 0.2s ease-in-out;
  }

  .nav-main li a:hover {
    transform: scale(1.1);
  }

  /* Shown instead of the "How It Works" text at ≤720px. */
  .nav-help-icon {
    display: none;
    width: 26px;
    height: 26px;
  }

/**********************
  * MAIN BODY *
***********************/

.content {
  padding: 40px;
  background-color: var(--background);
  flex: 1 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.background-image {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/resources/backgroundimg.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  mix-blend-mode: screen;
  z-index: -1;
  position: absolute;
  overflow: hidden;
}

.gif-section {
  display: flex;
  flex-wrap: wrap;
  /* Use viewport-based width and explicit centering so this row
     is independent from `.content` padding and can overlap it. */
  width: 90vw;
  max-width: 90vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
  /* Collapsed by default; expanded via .gif-section-visible */
  max-height: 0;
  min-height: 0;
  margin: 0 0 0 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease-out,
    margin-bottom 0.35s ease-out,
    opacity 0.25s ease-out;
}

.gif-section-visible {
  /* The vh cap exists for the open animation; the px floor keeps short viewports
     from clipping the cards (5 Instant Smokes stacked on phones ≈ 2300px). */
  max-height: max(260vh, 4000px);
  min-height: 24vw;
  margin-bottom: 2em;
  opacity: 1;
  padding: 1em;
}

@media (max-width: 960px) {
  .gif-section-visible {
    max-height: max(500vh, 4000px);
    min-height: 40vw;
    padding: 0;
  }
}

.content h2 {
  color: var(--text);
  text-align: center;
}

.map-select {
  color: var(--text);
  text-align: center;
}

.smoke-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  /* max-width: 90vw; */
  color: white;
}

/* Skeleton loaders */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.skeleton {
  background-color: #1e2938;
  background-image: linear-gradient(135deg, #1e2938 0%, #0f1727 100%);
}

.skeleton-animated {
  background-image: linear-gradient(
    90deg,
    #1e2938 0px,
    #2a3441 40px,
    #1e2938 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.2s ease-in-out infinite;
}

.no-results-message {
  flex: 1 1 100%;
  text-align: center;
  color: var(--text);
  font-size: 1.1rem;
  padding: 2rem 1rem;
  max-width: 32rem;
  margin: 2rem auto 0 auto;
}

.flip-button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: white;
  transition: transform 0.2s ease;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-footer .flip-button {
  margin-left: auto;
}

.smoke-auswahl.flipped {
  transition: transform 0.3s ease;
}

.back-side {
  display: none;
}

.smoke-auswahl.flipped .back-side {
  display: block;
}

.smoke-auswahl.flipped .front-side {
  display: none;
}

.smoke-auswahl {
  background: linear-gradient(135deg, #1e2938 0%, #0f1727 100%);
  border: 2px solid rgb(33, 61, 107);
  border-radius: 0.8em;
  padding: 1em;
  margin: 1em;
  text-align: center;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  flex-basis: calc(16% - 2em); /* Adjusted flex-basis value to create more space for the .selected styling */
}

.smoke-media {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 0.3em;
}

.smoke-media img,
.smoke-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  font-size: 0;
  line-height: 0;
}

.smoke-media-grid {
  height: 300px;
}

.smoke-media-map-selector {
  height: auto;
  padding: 15px;
}

.smoke-media-selected {
  /* Fixed square box (sources are square). This keeps the original preview
     proportions and reserves the media area, so flipping to a not-yet-loaded
     back image never collapses the card's width. */
  width: 350px;
  height: 350px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}

.smoke-auswahl img {
  width: 300px;
  height: 300px;
  border-radius: 0.3em;
}

.smoke-auswahl.selectamap img {
  width: 250px;
  height: 250px;
  padding: 15px;
  border-radius: 0.3em;
  object-fit: contain;
}

.selected-smoke-card.show.flipped img {
  width: 100%;
  height: 100%;
  border-radius: 0.3em;
}

.selected-smoke-card.show .smoke-media video {
  width: 100%;
  height: 100%;
  border-radius: 0.3em;
}

@media (min-width: 1280px) {
  .smoke-auswahl.flipped:hover {
    transform: scale(1.05);
    cursor: default;
  }

  .smoke-auswahl:hover {
    border: 2px solid #26489a;
    box-shadow: 0 0 1em rgba(255, 137, 6, 0.5);
    transform: scale(1.05);
    cursor: pointer;
  }

  .flip-button:hover {
    transform: scale(1.2);
  }
}

.smoke-cards .smoke-auswahl.selected {
  border: 2px solid rgba(255, 137, 6, 0.5);
  box-shadow: 0 0 1em rgba(255, 137, 6, 0.5);
  transform: scale(1.05);
}

/* Map selector cards: style separately from regular smoke cards */
.smoke-cards .smoke-auswahl.selectamap {
  position: relative; /* override or add styles for "Select a Map" cards here */
}

.smoke-cards .smoke-auswahl.selectamap h3 {
  display: none;
}

.smoke-cards .smoke-auswahl.selectamap p {
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  color: var(--text);
}

.hidden {
  display: none;
}

.selected-smoke-card .smoke-auswahl {
  max-width: 430px;
  color: white;
}

.gif-section .smoke-auswahl video {
  width: 100%;
  height: auto;
}


footer {
  color: white;
  background: linear-gradient(180deg, #1b2432 0%, #141b2a 100%);
  padding: 15px;
  text-align: center;
  width: 100%;
  border-top: 2px solid #1e2939;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-logo img {
  height: 60px;
  width: auto;
}

.footer-logo h1 {
  font-size: 1.5em;
  margin: 0;
}

.footer-nav {
  display: flex;
  justify-content: center;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-right: 10px;
  display: inline-block;
}

.footer-nav a {
  text-decoration: none;
  color: white;
}

.footer-logo h1 a {
  text-decoration: none;
  color: white;
}

.footer-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  /* Same height as the nav tap targets, so the header doesn't look shrunken. */
  .nav-left .nav-logo img {
    height: 44px;
    width: auto;
    display: block;
    padding: 0 0;
  }

  .nav-left h1 {
    font-size: 1em;
    margin: 0.3em;
  }

  /* Text + gear stacked badly here; the help icon keeps them on one row. */
  .nav-main {
    flex-direction: row;
  }

  .nav-main ul {
    display: flex;
    justify-content: center;
  }

  .nav-main li {
    margin: 0 0.5em;
  }

  .nav-main li a {
    /* Block, not inline-block: avoids the line box's descender gap that
       pushed the icon above the gear. */
    display: block;
    margin-right: 0;
    /* 26px icon + 9px padding = 44px tap target, same as the gear. */
    padding: 9px;
  }

  .nav-main li a .nav-help-text {
    display: none;
  }

  .nav-main li a .nav-help-icon {
    display: block;
  }

  .dropdown-container {
    padding: 0.5em;
  }

  .dropdown {
    margin: 1em;
  }

  .smoke-cards {
    flex-direction: column;
    align-items: center;
  }

  .smoke-auswahl {
    flex-basis: calc(50% - 2em); /* Adjust the flex-basis value for mobile devices */
  }

  .smoke-media,
  .smoke-media-grid,
  .smoke-media-map-selector,
  .smoke-media-selected {
    height: auto;
  }

  .smoke-media img,
  .smoke-media video {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

.cookie-wrapper {
  position: fixed;
  bottom: 20px;
  right: -345px;
  max-width: 345px;
  background: #fff;
  border-radius: 8px;
  padding: 15px 25px 22px;
  transition: right 0.3s ease;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.cookie-wrapper.show {
  right: 20px;
}

.cookie-wrapper header {
  display: flex;
  align-items: center;
  column-gap: 15px;
}
header i {
  color: #4070f4;
  font-size: 32px;
}
header h2 {
  color: #4070f4;
  font-weight: 500;
}
.cookie-wrapper .data {
  margin-top: 16px;
}
.cookie-wrapper .data p {
  color: #333;
  font-size: 16px;
}
.data p a {
  color: #4070f4;
  text-decoration: none;
}
.data p a:hover {
  text-decoration: underline;
}
.cookie-wrapper .buttons {
  margin-top: 16px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.buttons .button {
  border: none;
  color: #fff;
  padding: 8px 0;
  border-radius: 4px;
  background: #4070f4;
  cursor: pointer;
  width: calc(100% / 2 - 10px);
  transition: all 0.2s ease;
}
.buttons #acceptBtn:hover {
  background-color: #034bf1;
}


.scroll-to-top-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: transparent;
  border: none;
  border-radius: 50%;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
  padding: 10px;
  cursor: pointer;
  opacity: 0;
  transition: background-color 0.3s, opacity 0.3s ease-in-out;
  z-index: 1100;
}

.scroll-to-top-button img {
  width: 30px;
  height: 30px;
}

.scroll-to-top-button:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.scroll-to-top-button.show {
  opacity: 1;
}

/* ========== V2 overrides ========== */

.background-image {
  display: none;
}

.selected-smoke-card.show video,
.selected-smoke-card.show img {
  width: 100%;
  height: 100%;
  display: block;
}

.smoke-auswahl {
  padding: 0.75em;
}

.smoke-auswahl .smoke-auswahl-title,
.selected-smoke-card .smoke-auswahl-title {
  font-size: 0.8em;
  margin-top: 0.4em;
  color: lightgray;
  font-weight: 400;
}

.smoke-auswahl .smoke-auswahl-info,
.selected-smoke-card .smoke-auswahl-info {
  font-size: 1em;
  line-height: 1.3;
  color: var(--text);
  font-weight: 600;
}

.smoke-auswahl .front-side,
.smoke-auswahl .back-side {
  text-align: left;
  width: 100%;
  max-width: 100%;
}

.smoke-auswahl .flip-button {
  display: block;
  margin-left: auto;
}

.selected-smoke-card .smoke-auswahl .front-side,
.selected-smoke-card .smoke-auswahl .back-side {
  text-align: left;
  width: 100%;
  max-width: 100%;
}

.selected-smoke-card .smoke-auswahl .flip-button {
  display: block;
  margin-left: auto;
}

.content {
  padding: 40px 210px 40px 210px;
}

@media (max-width: 1140px) {
  .content {
    padding: 40px 80px;
  }
}

@media (max-width: 960px) {
  .content {
    padding: 40px 48px;
  }
}

/* Content header: title left, filters right */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 90vw;
  margin-bottom: 1.5em;
}

.main-title {
  font-size: 2rem;
  font-weight: 600;
  text-align: left;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.5px;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

@media (max-width: 1600px) {
  .content-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
  }

  .main-title {
    text-align: center;
  }

  .content-header .filters-group {
    justify-content: center;
  }

  .content {
    padding: 40px 80px;
  }
}

.filters-label {
  font-size: 1rem;
  color: var(--text);
}

/* Desktop search: left of dropdowns */
.search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.search-input {
  background: #18202b;
  color: var(--text);
  border: 1px rgb(33, 61, 107) solid;
  border-radius: 0.5em;
  padding: 1em;
  padding-right: 2.6em;
  width: 12em;
  font-family: var(--font);
  font-size: 1rem;
}

/* Hide the browser's native search clear so we only show our custom one */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* Inline "clear search" button */
.search-input-wrapper {
  position: relative;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 0.55em;
  transform: translateY(-50%);
  width: 1.6em;
  height: 1.6em;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgb(33, 61, 107);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

/* SVG instead of a "×" glyph: the glyph sits below the box's center. Sized in
   em so it follows each button's font-size. */
.close-icon {
  width: 1em;
  height: 1em;
  display: block;
}

.search-clear.is-visible {
  display: inline-flex;
}

.search-clear:hover {
  background: #26489a;
}

/* Contextual toolbar controls: Deselect All, Pause Clips + Instant Smokes toggle */
.preview-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  height: 44px;
  padding: 0 0.9em;
  border: 1px rgb(33, 61, 107) solid;
  border-radius: 0.75em;
  background: #18202b;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.preview-control:hover {
  background: rgb(33, 61, 107);
}

.preview-control-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.insta-toggle.is-active {
  border-color: rgba(255, 137, 6, 0.75);
  box-shadow: 0 0 0.7em rgba(255, 137, 6, 0.25);
  background: rgba(255, 137, 6, 0.12);
}

/* Compact, centered "Deselect All" above the preview; minimal vertical
   footprint so it doesn't push the cards down noticeably. */
.preview-toolbar {
  display: flex;
  justify-content: center;
  gap: 0.35em;
  margin: 0 0 0.35em 0;
}

.deselect-all,
.pause-toggle {
  height: 32px;
  padding: 0 0.7em;
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border-color: transparent;
  color: rgba(247, 247, 247, 0.5);
  box-shadow: none;
}

.deselect-all .preview-control-icon,
.pause-toggle .preview-control-icon {
  width: 16px;
  height: 16px;
}

.deselect-all:hover,
.pause-toggle:hover {
  background: #18202b;
  border-color: rgb(33, 61, 107);
  color: var(--text);
}

/* Show the action the button will perform: pause while playing, play while paused. */
.pause-toggle .play-icon,
.pause-toggle[aria-pressed="true"] .pause-icon {
  display: none;
}

.pause-toggle[aria-pressed="true"] .play-icon {
  display: block;
}

.search-input::placeholder {
  color: rgba(247, 247, 247, 0.6);
}

.search-input:focus {
  outline: none;
  border-color: #26489a;
  box-shadow: 0 0 0 1px #26489a;
}

.filters-reset-desktop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px rgb(33, 61, 107) solid;
  border-radius: 0.75em;
  background: #18202b;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.filters-reset-desktop:hover {
  background: rgb(33, 61, 107);
}

.filters-reset-desktop-icon {
  width: 22px;
  height: 22px;
  display: block;
}

/* Mobile filters: icon trigger + fullscreen overlay */
.filters-toggle {
  display: none; /* shown on <= 820px */
  position: relative;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px rgb(33, 61, 107) solid;
  border-radius: 0.75em;
  background: #18202b;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.filters-toggle:hover {
  background: rgb(33, 61, 107);
}

.filters-toggle:active {
  transform: scale(0.98);
}

.filters-toggle-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.filters-toggle-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 137, 6, 0.95);
  box-shadow: 0 0 0 2px #18202b;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.filters-toggle-badge.is-active {
  opacity: 1;
  transform: scale(1);
}

.filters-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.filters-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.filters-overlay-content {
  position: absolute;
  inset: 0;
  background: var(--background);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding: 1em;
}

.filters-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  padding-bottom: 0.75em;
  border-bottom: 1px solid #1e2939;
}

.filters-overlay-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.filters-overlay-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.filters-reset {
  border: 1px rgb(33, 61, 107) solid;
  background: #18202b;
  color: var(--text);
  border-radius: 0.75em;
  padding: 0.55em 0.8em;
  cursor: pointer;
  height: 42px;
}

.filters-close {
  border: 1px rgb(33, 61, 107) solid;
  background: #18202b;
  color: var(--text);
  border-radius: 0.75em;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filters-overlay-body {
  flex: 1;
  overflow: auto;
  padding: 1em 0;
  display: flex;
  flex-direction: column;
  gap: 1.25em;
}

.filters-section-search .search-input-overlay {
  width: 100%;
  background: #18202b;
  color: var(--text);
  border: 1px rgb(33, 61, 107) solid;
  border-radius: 0.5em;
  padding: 0.75em 2.6em 0.75em 1em;
  font-family: var(--font);
  font-size: 1rem;
}

.filters-section-search .search-input-overlay::placeholder {
  color: rgba(247, 247, 247, 0.6);
}

.filters-section-search .search-input-overlay:focus {
  outline: none;
  border-color: #26489a;
  box-shadow: 0 0 0 1px #26489a;
}

.filters-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75em;
  color: var(--text);
  text-align: left;
}

.filters-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
}

.filters-option {
  border: 1px rgb(33, 61, 107) solid;
  background: #18202b;
  color: var(--text);
  border-radius: 0.9em;
  padding: 0.75em 0.9em;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filters-option:active {
  transform: scale(0.99);
}

.filters-option.is-active {
  border-color: rgba(255, 137, 6, 0.75);
  box-shadow: 0 0 0.7em rgba(255, 137, 6, 0.15);
}

.filters-overlay-footer {
  padding-top: 0.75em;
  border-top: 1px solid #1e2939;
}

.filters-apply {
  width: 100%;
  border: none;
  border-radius: 0.9em;
  padding: 0.9em 1em;
  background: #26489a;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.filters-apply:hover {
  background: #2f57b9;
}

.content-header .dropdown-container {
  justify-content: flex-end;
  margin: 0;
}

.content-header .dropdown {
  margin: 0 0 0 0.5em;
}

@media (max-width: 720px) {
  .content-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
  }

  .content-header .dropdown-container {
    width: 100%;
    justify-content: flex-start;
  }

  .content-header .dropdown {
    margin: 0 0.5em 0 0;
  }

  .smoke-cards .smoke-auswahl {
    max-width: 75%;
    min-width: 0;
  }
}

/* Switch filters to fullscreen overlay on mobile/tablet */
@media (max-width: 820px) {
  .content-header .dropdown-container {
    display: none;
  }

  .content-header .search-wrapper {
    display: none;
  }

  .content-header .filters-reset-desktop {
    display: none;
  }

  .filters-toggle {
    display: inline-flex;
  }
}

/* Small viewport: prevent overflow down to 320px */
@media (max-width: 600px) {
  .content {
    padding: 24px 1em;
  }

  .content-header {
    max-width: 100%;
  }

  .main-title {
    font-size: 1.25rem;
  }

  .filters-group {
    flex-wrap: wrap;
    gap: 0.5em;
  }

  .content-header .dropdown {
    min-width: 0;
    flex: 1 1 120px;
    margin: 0 0.5em 0 0;
  }

  .content-header .dropdown-container {
    flex-wrap: wrap;
    gap: 0.5em;
  }

  .content-header .select {
    padding: 0.6em 0.5em;
  }

  .smoke-cards .smoke-auswahl {
    max-width: 75%;
    min-width: 0;
  }

  .smoke-cards .smoke-auswahl img {
    max-width: 100%;
    height: auto;
  }

  .smoke-cards .smoke-auswahl.selectamap img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 500px) {
  .filters-group {
    flex-direction: column;
  }

  .content-header .dropdown-container {
    flex-direction: column;
    width: 100%;
  }

  .content-header .dropdown {
    width: 100%;
    max-width: 100%;
  }

  .content-header .select {
    width: 100%;
    max-width: 100%;
  }

  /* The 350px preview media plus card chrome is wider than 90vw on phones;
     give the slot a definite width so the card and its media can shrink. */
  .gif-section-visible .selected-smoke-card {
    width: 100%;
    min-width: 0;
  }

  .gif-section-visible .smoke-auswahl {
    margin: 0.7em 0;
    max-width: 100%;
  }
}

/* ========== Card Customizer ========== */

.nav-main {
  align-items: center;
}

.nav-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.nav-settings:hover {
  transform: scale(1.1) rotate(30deg);
}

.nav-settings-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2em 1em;
  /* Scroll the whole modal only if it ever exceeds the viewport; the modal
     itself is not a scroll container, so open dropdowns overlay rather than
     adding an inner scrollbar. */
  overflow-y: auto;
}

.cc-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cc-modal {
  width: 100%;
  max-width: 720px;
  /* Auto margins center the modal but, unlike align-items:center, fall back to
     top alignment when it's taller than the viewport (e.g. Steam overlay), so
     the header and close button stay reachable by scrolling. */
  margin: auto;
  overflow: visible;
  background: var(--background);
  color: var(--text);
  border: 1px solid rgb(33, 61, 107);
  border-radius: 0.9em;
  box-shadow: 0 0.75em 2em rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  padding: 1em 1.25em;
  border-bottom: 1px solid #1e2939;
}

.cc-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.cc-close {
  border: 1px rgb(33, 61, 107) solid;
  background: #18202b;
  color: var(--text);
  border-radius: 0.75em;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-close:hover {
  background: rgb(33, 61, 107);
}

.cc-body {
  padding: 1.25em;
}

.cc-hint {
  font-size: 0.95rem;
  color: rgba(247, 247, 247, 0.7);
  margin-bottom: 1.25em;
  text-align: center;
}

.cc-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  margin-top: 1.5em;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.cc-option input {
  width: 18px;
  height: 18px;
  accent-color: rgb(255, 137, 6);
  cursor: pointer;
}

.cc-hint.cc-option-hint {
  margin: 0.4em 0 0;
  font-size: 0.8rem;
}

.cc-skeletons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
  justify-content: center;
}

.cc-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75em;
  flex: 1 1 240px;
  max-width: 300px;
}

.cc-skeleton-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 247, 247, 0.5);
}

.cc-card {
  width: 100%;
  margin: 0;
}

/* The skeleton reuses `.smoke-auswahl`, so cancel the real card's hover
   affordances (scale/glow/pointer) since it isn't clickable. */
.cc-card:hover {
  border-color: rgb(33, 61, 107);
  box-shadow: none;
  transform: none;
  cursor: default;
}

.cc-media {
  /* Match the real selected card's square (1:1) media box. */
  aspect-ratio: 1 / 1;
  height: auto;
  margin-bottom: 0.5em;
}

.cc-slot-preview {
  min-height: 1.2em;
}

.cc-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  width: 100%;
}

.cc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  text-align: left;
}

.cc-field-label {
  font-size: 0.8rem;
  color: rgba(247, 247, 247, 0.7);
}

.cc-dropdown {
  min-width: 0;
  width: 100%;
  margin: 0;
}

.cc-dropdown .select {
  width: 100%;
  padding: 0.6em 0.8em;
}

.cc-dropdown .menu {
  top: 3.1em;
  /* Float above the field below it and the footer so every option is
     clickable while the menu is open. */
  z-index: 30;
}

.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  padding: 1em 1.25em;
  border-top: 1px solid #1e2939;
}

.cc-reset {
  border: 1px rgb(33, 61, 107) solid;
  background: #18202b;
  color: var(--text);
  border-radius: 0.75em;
  padding: 0.7em 1em;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
}

.cc-reset:hover {
  background: rgb(33, 61, 107);
}

.cc-done {
  border: none;
  border-radius: 0.75em;
  padding: 0.7em 1.5em;
  background: #26489a;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}

.cc-done:hover {
  background: #2f57b9;
}

@media (max-width: 600px) {
  .cc-overlay {
    padding: 0;
  }

  .cc-modal {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    /* Full-screen on mobile: scroll inside the modal (base is overflow:visible). */
    overflow: auto;
  }
}

@media (max-width: 320px) {
  .content {
    padding: 12px 0.75em;
  }

  /* 44px logo + (?) + gear doesn't fit one row at this width. */
  .nav-left .nav-logo img {
    height: 36px;
  }

  .main-title {
    font-size: 1rem;
  }

  .content-header .dropdown-container {
    max-width: 100%;
  }

  .content-header .dropdown {
    min-width: 0;
    max-width: 100%;
  }

  .smoke-cards .smoke-auswahl.selectamap {
    overflow: hidden;
    min-width: 0;
  }

  .smoke-cards .smoke-auswahl.selectamap img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
}

/* ========== Privacy / Terms / Contact (legal) pages ========== */

.legal {
  text-align: left;
}

.legal.contact .legal-section.contact-email-section {
  text-align: center;
  border-top: none;
  padding-top: 0;
}

.legal.contact .contact-email-section a {
  font-size: 1.25rem;
}

.legal-intro,
.legal-section {
  max-width: 720px;
  margin: 0 auto;
}

.legal-intro {
  text-align: center;
  padding-bottom: 2em;
}

.legal-lead {
  margin: 1em auto 0.75em;
  color: rgba(247, 247, 247, 0.7);
}

.legal-updated {
  margin-top: 0.5em;
  font-size: 0.9rem;
  color: rgba(247, 247, 247, 0.45);
}

.legal-section {
  padding: 1.75em 0;
  border-top: 1px solid #1e2939;
}

.legal-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6em;
}

.legal-section p {
  font-size: 1rem;
  color: rgba(247, 247, 247, 0.7);
}

.legal-section p + p {
  margin-top: 0.8em;
}

.legal-section a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-section a:hover {
  color: var(--accent);
}

.legal-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--text);
  background: #18202b;
  border: 1px solid rgb(33, 61, 107);
  border-radius: 0.35em;
  padding: 0.1em 0.35em;
}

/* ========== How It Works page ========== */

/* Text column + media column per step, alternating sides. Reuses the card
   surface/outline and button colors from the main page. */
.hiw {
  text-align: left;
}

.hiw-intro,
.hiw-step,
.hiw-outro {
  max-width: 1200px;
  margin: 0 auto;
}

.hiw-intro {
  text-align: center;
  padding-bottom: 2.5em;
}

.hiw-lead {
  max-width: 640px;
  margin: 1em auto 1.5em;
  color: rgba(247, 247, 247, 0.7);
}

.hiw-cta {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 1.5em;
  background: #26489a;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.9em;
  transition: background 0.15s ease;
}

.hiw-cta:hover {
  background: #2f57b9;
}

.hiw-step {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3em;
  align-items: center;
  padding: 3em 0;
  border-top: 1px solid #1e2939;
}

/* Media on the left: keep it in the wider column. */
.hiw-step:nth-of-type(even) {
  grid-template-columns: 1.4fr 1fr;
}

.hiw-step:nth-of-type(even) .hiw-text {
  order: 2;
}

.hiw-step-label {
  display: block;
  margin-bottom: 0.5em;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 247, 247, 0.5);
}

.hiw-text h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6em;
}

.hiw-text p {
  font-size: 1rem;
  color: rgba(247, 247, 247, 0.7);
}

.hiw-text p + p {
  margin-top: 0.8em;
}

.hiw-text strong,
.hiw-text em {
  color: var(--text);
}

.hiw-text strong {
  font-weight: 600;
}

.hiw-media {
  margin: 0;
  padding: 10px;
  background: linear-gradient(135deg, #1e2938 0%, #0f1727 100%);
  border: 2px solid rgb(33, 61, 107);
  border-radius: 0.8em;
}

/* Portrait or small media would blow up to the full column width. */
.hiw-media-narrow {
  justify-self: center;
  max-width: 460px;
}

.hiw-media img,
.hiw-media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.3em;
}

.hiw-keys {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  color: var(--text);
}

.hiw-keys div {
  display: flex;
  align-items: center;
  gap: 1em;
}

.hiw-keys dt {
  min-width: 3.5em;
}

.hiw-keys dd {
  margin: 0;
  color: rgba(247, 247, 247, 0.7);
}

kbd {
  display: inline-block;
  padding: 0.2em 0.6em;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
  background: #18202b;
  border: 1px solid rgb(33, 61, 107);
  border-radius: 0.5em;
}

.hiw-outro {
  text-align: center;
  padding: 2.5em 0 1em;
  border-top: 1px solid #1e2939;
}

@media (max-width: 720px) {
  .hiw-step,
  .hiw-step:nth-of-type(even) {
    grid-template-columns: 1fr;
    gap: 1.5em;
    padding: 2em 0;
  }

  .hiw-step:nth-of-type(even) .hiw-text {
    order: 0;
  }
}
