:root {
  --max-w: 1640px;
  --ratio-w: 16;
  --ratio-h: 5;
  --corner: 1.5vw;
  --title-left: 2.1vw;
  --title-bottom: 1.8vw;
  --title-h: 4vw;
  --btn-h: 3.3vw;
  --btn-pad: 1.25% 1.75%;
  --btn-gap: 1.25%;
  --badge-h: 7vw;
  --bp1: 800px;
  --bp2: 500px;

  /* filters theme */
  --ui-bg: #0b0b0c;
  --ui-elev: #141416;
  --ui-border: #292a2d;
  --ui-hover: #1e2023;
  --ui-text: #e9e9ec;
  --ui-dim: #9aa0a6;
  --ui-accent: #7dd1ff;
  --ui-accent-2: #9bffcf;
  --radius: 12px;
}

/* page */
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: #000;
  color: #fff;
  user-select: none;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
}
#app {
  display: grid;
  gap: 2vw;
  padding: 2vw;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* filters bar */
.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 12px 16px;
  background: linear-gradient(180deg, #0a0a0a, #050505);
  border-bottom: 1px solid #141414;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.filters-left {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.filters-right {
  display: flex;
  gap: 0.6rem;
}

/* dropdown filter */
.filter {
  position: relative;
  min-width: 210px;
  max-width: 280px;
  flex: 0 0 auto;
}
.filter .toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--ui-elev);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.filter .toggle:hover {
  background: var(--ui-hover);
  border-color: #333;
}
.filter .label {
  font-size: 0.92rem;
  letter-spacing: 0.2px;
}
.filter .summary {
  font-size: 0.82rem;
  color: var(--ui-dim);
}
.filter .chev {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}
.filter.open .chev {
  transform: rotate(180deg);
}

.filter .menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 360px;
  max-width: 80vw;
  max-height: 52vh;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 8px;
  overflow: auto;
  display: none;
}
.filter.open .menu {
  display: block;
}
.menu .row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ui-text);
  font-size: 0.92rem;
}
.menu .row:hover {
  background: #14161a;
}
.menu .row input {
  accent-color: var(--ui-accent);
  transform: translateY(1px);
}

.menu .actions {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 8px 10px 4px;
}
.menu .btn {
  background: var(--ui-elev);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}
.menu .btn:hover {
  background: var(--ui-hover);
}
.menu .btn.primary {
  border-color: #2b3340;
  background: linear-gradient(180deg, #1a2430, #151c27);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* reset all */
.btn-reset {
  background: linear-gradient(180deg, #1d1d1f, #141416);
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}
.btn-reset:hover {
  background: #191b1f;
}

/* chips preview inside toggle */
.filter .summary .chip {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #1c2026;
  border: 1px solid #2b2f35;
  color: #cfe7ff;
  font-size: 0.75rem;
}

/* Card */
.card {
  display: flex;
  width: 100%;
  aspect-ratio: var(--ratio-w) / var(--ratio-h);
  overflow: hidden;
  border-radius: var(--corner);
  box-shadow: 0 0 3vw rgba(0, 0, 0, 0.4);
  position: relative;
  background: #000;
}
.side-image {
  flex: none;
  aspect-ratio: 1/1;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.side-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.black-box {
  background: #000;
  flex: 1;
  position: relative;
  overflow: hidden;
}
.black-box img {
  position: absolute;
  left: min(3vw, 63px);
  bottom: min(2.5vw, 33px);
  height: min(3.5vw, 55px);
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.frame {
  position: relative;
  flex: 1;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.buttons {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: var(--btn-gap);
  padding: 2.25% 0 2.25% 2.25%;
  z-index: 2;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: min(var(--btn-h), 55px);
  padding: var(--btn-pad);
  background: transparent;
  text-decoration: none;
  border: 0;
  z-index: 3;
}
.btn:hover {
  opacity: 0.9;
  filter: invert(0.1);
}
.btn img {
  height: 100%;
  width: auto;
  display: block;
  pointer-events: auto;
}

/* Badge with multiple resolution icons */
.badge {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 2.25% 2.25% 2.25% 0;
  z-index: 1;

  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.badge img {
  display: block;
  height: min(var(--badge-h), 120px);
  width: auto;
  max-width: min(38vw, 1140px);
  pointer-events: none;
}

@media (max-width: 800px) {
  .card {
    flex-direction: column;
    aspect-ratio: auto;
  }
  .side-image {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
  }
  .btn {
    height: 26%;
    padding: 2% 2.5%;
  }
  .badge img {
    height: 30%;
  }
}
@media (max-width: 500px) {
  .btn {
    height: 30%;
    padding: 3% 3%;
  }
  .badge img {
    height: 36%;
  }
}

.hidden {
  display: none !important;
}
