.effects-library-page {
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 234, 255, 0.16), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(255, 204, 0, 0.12), transparent 30%),
    radial-gradient(circle at 50% 110%, rgba(255, 26, 102, 0.12), transparent 45%),
    linear-gradient(160deg, #050407 0%, #110710 48%, #071017 100%);
}

.effects-library-main {
  gap: 1rem;
}

.effects-library-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: clamp(0.8rem, 1.8vw, 1.35rem) 0.25rem 0.25rem;
}

.effects-library-heading {
  min-width: 0;
}

.effects-library-heading .eyebrow {
  color: var(--brand-cool);
}

.effects-library-heading h1 {
  font-size: clamp(2.25rem, 4.7vw, 4.4rem);
  letter-spacing: 0;
}

.effects-library-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(5.8rem, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.effects-library-meter div {
  min-width: 0;
  border: 1px solid rgba(143, 247, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(12, 20, 28, 0.78), rgba(26, 10, 21, 0.72));
  padding: 0.72rem 0.78rem;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.effects-library-meter dt {
  margin: 0 0 0.24rem;
  color: #b7ddeb;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.effects-library-meter dd {
  margin: 0;
  font-family: "CookieRun KR", "Outfit", sans-serif;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
}

.effects-library-controls {
  border: 1px solid rgba(255, 188, 210, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(17, 9, 18, 0.84), rgba(7, 15, 21, 0.76));
  padding: 0.85rem;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.effects-controls-content {
  display: grid;
  grid-template-columns: minmax(14rem, 1.25fr) minmax(10rem, 0.55fr) minmax(10rem, 0.55fr) minmax(20rem, 1.5fr);
  gap: 0.72rem;
  align-items: end;
}

/* Toggle only appears on mobile (see the max-width: 760px block). */
.effects-controls-toggle-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.effects-controls-toggle {
  display: none;
}

.effects-control {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.effects-control span,
.effects-cookie-filter > label {
  font-family: "CookieRun KR", "Outfit", sans-serif;
  color: #fff;
  font-size: 0.86rem;
}

.effects-control input,
.effects-control select {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid rgba(143, 247, 255, 0.2);
  border-radius: 8px;
  background: rgba(5, 8, 13, 0.72);
  color: #fff;
  font: 700 0.95rem "Outfit", sans-serif;
  outline: none;
  padding: 0.65rem 0.78rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.effects-control input:focus,
.effects-control select:focus {
  border-color: rgba(143, 247, 255, 0.68);
  background: rgba(7, 13, 20, 0.88);
  box-shadow: 0 0 0 3px rgba(0, 234, 255, 0.12);
}

.effects-cookie-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
}

.effects-button {
  min-height: 2.65rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-family: "CookieRun KR", "Outfit", sans-serif;
  font-size: 0.86rem;
  padding: 0.55rem 0.78rem;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.effects-button:hover,
.effects-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(143, 247, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.effects-button-primary {
  border-color: rgba(143, 247, 255, 0.42);
  background: linear-gradient(135deg, rgba(0, 234, 255, 0.22), rgba(255, 204, 0, 0.16));
}

.effects-library-status {
  display: grid;
  gap: 0.45rem;
  align-items: start;
  min-height: 2rem;
  color: #d9ebf1;
  font-size: 0.94rem;
  padding: 0 0.3rem;
}

.effects-library-status p {
  margin: 0;
}

#cookieFilterStatus {
  color: #ffe7a1;
}

#cookieFilterStatus.has-cookie-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.effects-filter-cookie-icon-frame {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  border: 1px solid rgba(255, 231, 161, 0.46);
  border-radius: 0.58rem;
  background:
    linear-gradient(145deg, rgba(255, 231, 161, 0.16), rgba(143, 247, 255, 0.08)),
    rgba(4, 8, 18, 0.72);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.effects-filter-cookie-icon-frame img,
.effects-filter-cookie-icon-placeholder {
  display: block;
  width: 100%;
  height: 100%;
}

.effects-filter-cookie-icon-frame img {
  object-fit: cover;
}

.effects-filter-cookie-icon-placeholder {
  display: grid;
  place-items: center;
  color: #ffe7a1;
  font-family: "CookieRun KR", "Outfit", sans-serif;
  font-size: 0.74rem;
}

.effects-results {
  display: grid;
  gap: 1rem;
}

.effects-group {
  display: grid;
  gap: 0.75rem;
}

.effects-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 0.25rem 0.45rem;
}

.effects-group-heading h2 {
  font-size: clamp(1.35rem, 2.1vw, 2rem);
}

.effects-group-heading span {
  border: 1px solid rgba(143, 247, 255, 0.22);
  border-radius: 999px;
  color: #bcefff;
  font-weight: 800;
  min-width: 2.25rem;
  padding: 0.2rem 0.62rem;
  text-align: center;
}

.effects-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 0.72rem;
}

.effect-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.78rem;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(6, 9, 14, 0.76);
  padding: 0.82rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.26);
}

.effect-card-icon-shell {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: fit-content;
  height: fit-content;
  padding: 0.25rem;
  border: 1px solid rgba(143, 247, 255, 0.18);
  border-radius: 8px;
  background: radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.13), rgba(10, 14, 22, 0.72));
}

.effect-card-icon-shell img {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.45));
}

.effect-icon-placeholder {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.24), rgba(255, 26, 102, 0.18));
  color: #fff4bd;
  font-family: "CookieRun KR", "Outfit", sans-serif;
  font-size: 0.9rem;
}

.effect-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  height: 100%;
}

.effect-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.effect-card-title-lead {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.effect-card-title-row h3 {
  min-width: 0;
  font-size: 1.08rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.effect-kind-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(143, 247, 255, 0.24);
  border-radius: 999px;
  color: #bcf6ff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.46rem;
  white-space: nowrap;
}

.effect-card-description {
  margin: 0;
  color: #e8dfe8;
  font-size: 0.92rem;
  line-height: 1.32;
}

.effect-card-meta,
.effect-card-aliases,
.effect-card-related {
  margin: 0;
  color: #b8c9d6;
  font-size: 0.78rem;
  line-height: 1.25;
}

.effect-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  height: fit-content;
}

.effect-card-meta span {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  padding: 0.12rem 0.42rem;
}

.effect-source-link {
  justify-self: start;
  color: #8ff7ff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.effect-source-link:hover,
.effect-source-link:focus-visible {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

.effect-card-more {
  /* Anchor the frame to the bottom of the card so it lines up across a
     row regardless of how long each description is. */
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.effect-card-more[open] {
  /* Once expanded, drop the bottom anchor so the frame sits directly
     under the description and grows downward naturally. Collapsed
     cards keep the anchor above. */
  margin-top: 0;
}

.effect-card-more-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  color: #bcefff;
  font-family: "CookieRun KR", "Outfit", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.effect-card-more-summary::-webkit-details-marker {
  display: none;
}

.effect-card-more-summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.effect-card-more[open] .effect-card-more-summary::after {
  transform: rotate(225deg);
}

.effect-card-more-summary:focus-visible {
  outline: 2px solid rgba(143, 247, 255, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Only lay out the content when open — setting display here
   unconditionally would override the browser's native collapse. */
.effect-card-more[open] .effect-card-more-content {
  display: grid;
  gap: 0.45rem;
  padding: 0 0.6rem 0.55rem;
}

.effects-empty-state {
  border: 1px solid rgba(255, 188, 210, 0.16);
  border-radius: 8px;
  background: rgba(8, 7, 12, 0.72);
  padding: 1.5rem;
}

.effects-empty-state h2 {
  font-size: 1.55rem;
}

.effects-empty-state p {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
}

@media (max-width: 1120px) {
  .effects-library-header,
  .effects-controls-content {
    grid-template-columns: 1fr;
  }

  .effects-library-meter {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .effects-library-main {
    padding-inline: 0.55rem;
  }

  .effects-library-header {
    padding-top: 0.55rem;
  }

  .effects-library-meter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .effects-cookie-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .effects-cookie-filter-row > input {
    grid-column: 1 / -1;
  }

  /* Collapse the whole controls panel behind a toggle on mobile. */
  .effects-controls-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    cursor: pointer;
    color: #fff;
    font-family: "CookieRun KR", "Outfit", sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
  }

  .effects-controls-toggle::after {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
  }

  .effects-controls-toggle-checkbox:checked ~ .effects-controls-toggle::after {
    transform: rotate(225deg);
  }

  .effects-controls-toggle-checkbox:focus-visible ~ .effects-controls-toggle {
    outline: 2px solid rgba(143, 247, 255, 0.6);
    outline-offset: 2px;
    border-radius: 6px;
  }

  .effects-controls-content {
    display: none;
  }

  .effects-controls-toggle-checkbox:checked ~ .effects-controls-content {
    display: grid;
    margin-top: 0.7rem;
  }

  .effects-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .effect-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.7rem;
  }

  .effect-card-icon-shell img,
  .effect-icon-placeholder {
    width: 2.65rem;
    height: 2.65rem;
  }

  .effect-card-title-row {
    gap: 0.45rem;
  }
}
