/* ------------------------------------------------------------------ */
/* Things Chris Enjoys — Majora's Mask inspired UI                     */
/* ------------------------------------------------------------------ */

:root {
  --bg: #080512;
  --bg-2: #0d081b;
  --panel: #150e28;
  --panel-2: #1d1434;
  --ink: #f6f1ff;
  --muted: #b3a5cf;
  --muted-2: #82759e;
  --gold: #e8c66a;
  --gold-soft: #f6e3a6;
  --gold-deep: #a97c2e;
  --violet: #9a6bf0;
  --pink: #e0679f;
  --teal: #56cfc3;
  --green: #77d06a;
  --orange: #ff9d4d;
  --blue: #5aa9ff;
  --line: rgba(214, 190, 255, 0.13);
  --line-strong: rgba(214, 190, 255, 0.24);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  --radius: 15px;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(232, 198, 106, 0.32);
  color: #fff;
}

.wrap {
  width: min(1180px, calc(100% - 44px));
  margin-inline: auto;
}

/* ------------------------------------------------------------------ */
/* Atmosphere                                                          */
/* ------------------------------------------------------------------ */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 720px at 18% -12%, rgba(116, 67, 196, 0.26), transparent 62%),
    radial-gradient(900px 620px at 96% 12%, rgba(36, 118, 132, 0.14), transparent 62%),
    radial-gradient(900px 700px at 50% 110%, rgba(224, 103, 159, 0.1), transparent 65%),
    linear-gradient(180deg, #0a0616 0%, #0c0718 42%, #080512 100%);
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(240, 216, 160, 0.13) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 88%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 88%);
  opacity: 0.55;
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(30deg, rgba(255, 255, 255, 0.016) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.016) 87.5%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.016) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.016) 87.5%);
  background-size: 58px 100px;
  opacity: 0.7;
}

.backdrop-moon {
  position: absolute;
  top: -190px;
  right: -130px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 42% 42%,
    rgba(255, 238, 184, 0.22) 0%,
    rgba(214, 168, 232, 0.12) 38%,
    rgba(120, 70, 180, 0.06) 58%,
    transparent 72%
  );
  filter: blur(6px);
}

.backdrop-ring {
  position: absolute;
  top: -80px;
  right: -60px;
  width: 470px;
  height: 470px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(232, 198, 106, 0.24) 0deg 0.55deg,
    transparent 0.55deg 15deg
  );
  mask: radial-gradient(circle, transparent 61%, #000 62.5%, #000 68%, transparent 69.5%);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 62.5%, #000 68%, transparent 69.5%);
  animation: slow-spin 240s linear infinite;
  opacity: 0.45;
}

.backdrop-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.backdrop-glow-a {
  width: 380px;
  height: 380px;
  left: -140px;
  top: 38%;
  background: rgba(120, 70, 200, 0.22);
}

.backdrop-glow-b {
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -80px;
  background: rgba(224, 103, 159, 0.12);
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Top bar                                                             */
/* ------------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(232, 198, 106, 0.3);
  background: rgba(232, 198, 106, 0.07);
  box-shadow: inset 0 0 18px rgba(232, 198, 106, 0.08);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.manage-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(22, 14, 40, 0.6);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: 0.2s ease;
}

.manage-link svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  opacity: 0.85;
}

.manage-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(32, 21, 55, 0.85);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.hero {
  padding: 54px 0 26px;
}

.hero-crest {
  width: 58px;
  color: var(--gold);
  filter: drop-shadow(0 0 20px rgba(232, 198, 106, 0.35));
  animation: crest-float 7s ease-in-out infinite;
}

.hero-crest svg {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes crest-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-7px) rotate(1.5deg);
  }
}

.eyebrow {
  margin: 22px 0 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.82;
}

.hero h1 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.55rem, 7.2vw, 4.9rem);
  line-height: 0.99;
  letter-spacing: -0.015em;
  color: #fbf6ff;
  text-wrap: balance;
}

.hero h1 span {
  background: linear-gradient(180deg, #fff4c9 5%, var(--gold) 52%, #b07a28 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(232, 198, 106, 0.22));
}

.tagline {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 2.1vw, 1.35rem);
  letter-spacing: 0.07em;
  color: var(--muted);
}

.hero-copy {
  max-width: 580px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.stat {
  min-width: 92px;
  padding: 10px 15px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 23, 58, 0.62), rgba(20, 13, 36, 0.5));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--gold-soft);
}

.stat b .stat-star {
  color: var(--gold);
  font-size: 14px;
  vertical-align: 2px;
  margin-right: 2px;
}

.stat b .stat-den {
  color: var(--muted-2);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  margin-left: 2px;
  letter-spacing: 0;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Tabs                                                                */
/* ------------------------------------------------------------------ */

.sticky-tabs {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 -6px;
  padding: 10px 6px;
  background: linear-gradient(180deg, rgba(8, 5, 18, 0.94) 0%, rgba(8, 5, 18, 0.8) 70%, rgba(8, 5, 18, 0) 100%);
  backdrop-filter: blur(14px);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 1px 6px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  align-self: center;
  margin: 0 2px;
  background: var(--line-strong);
}

.tab {
  --tab-accent: var(--gold);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(21, 13, 38, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tab svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.tab .count {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  transition: inherit;
}

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

.tab.active {
  color: #0b0616;
  background: linear-gradient(180deg, var(--tab-accent), color-mix(in srgb, var(--tab-accent) 68%, #000));
  border-color: transparent;
  box-shadow:
    0 8px 26px color-mix(in srgb, var(--tab-accent) 25%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tab.active svg {
  opacity: 1;
}

.tab.active .count {
  background: rgba(8, 5, 18, 0.28);
  color: rgba(8, 5, 18, 0.8);
}

/* ------------------------------------------------------------------ */
/* Toolbar                                                             */
/* ------------------------------------------------------------------ */

.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(20, 12, 36, 0.62);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.filter-trigger svg {
  width: 16px;
  height: 16px;
}

.filter-trigger:hover,
.filter-trigger[aria-expanded="true"] {
  color: var(--gold-soft);
  border-color: rgba(232, 198, 106, 0.42);
  background: rgba(232, 198, 106, 0.08);
}

.filter-count {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(232, 198, 106, 0.2);
  color: var(--gold-soft);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.filter-drawer {
  margin: 10px 0 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(120, 70, 200, 0.06), transparent 55%),
    rgba(15, 9, 28, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 40px rgba(0, 0, 0, 0.2);
  animation: filter-in 0.2s ease both;
}

@keyframes filter-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-drawer-head > span {
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.filter-close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s ease;
}

.filter-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.filter-grid .filter {
  width: 100%;
  justify-content: space-between;
  height: 40px;
  background: rgba(9, 5, 18, 0.4);
}

.filter-grid .ecchi-toggle {
  width: 100%;
  height: 40px;
  justify-content: flex-start;
  background: rgba(9, 5, 18, 0.4);
  white-space: nowrap;
}

.filter-grid .ecchi-toggle .ecchi-count {
  margin-left: auto;
}

.filter-low {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.filter-low .ecchi-toggle {
  flex: 1;
}

.filter-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(9, 5, 18, 0.4);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-mini select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: none;
  cursor: pointer;
}

.filter-mini select option {
  background: #140c24;
  color: var(--ink);
}

.filter-grid .filter-clear {
  grid-column: 1 / -1;
  justify-self: start;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(20, 12, 36, 0.55);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter select {
  max-width: 185px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.filter select option {
  background: #140c24;
  color: var(--ink);
}

.filter-clear {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(224, 103, 159, 0.32);
  background: rgba(224, 103, 159, 0.07);
  color: #ff9ec4;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
}

.filter-clear:hover {
  background: rgba(224, 103, 159, 0.14);
  border-color: rgba(224, 103, 159, 0.5);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.search {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 12, 36, 0.62);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}

.search:focus-within {
  border-color: rgba(232, 198, 106, 0.5);
  background: rgba(26, 17, 46, 0.8);
  box-shadow: 0 0 0 3px rgba(232, 198, 106, 0.08);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.kbd {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
}

.ecchi-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(20, 12, 36, 0.62);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ecchi-toggle:hover {
  color: var(--ink);
  border-color: rgba(224, 103, 159, 0.45);
  background: rgba(30, 18, 48, 0.8);
}

.ecchi-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ecchi-toggle .switch {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ecchi-toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.2s ease, background 0.2s ease;
}

.ecchi-toggle input:checked + .switch {
  border-color: transparent;
  background: linear-gradient(90deg, #e0679f, #b58cff);
}

.ecchi-toggle input:checked + .switch::after {
  left: 15px;
  background: #fff;
}

.ecchi-toggle input:checked ~ .ecchi-label {
  color: #ffb1d2;
}

.ecchi-toggle input:focus-visible + .switch {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ecchi-count {
  display: inline-block;
  min-width: 16px;
  margin-left: 1px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(224, 103, 159, 0.14);
  color: #ff9ec4;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.ecchi-pill {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid rgba(224, 103, 159, 0.45);
  background: rgba(30, 8, 22, 0.8);
  color: #ff9ec4;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.sort {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sort select {
  height: 42px;
  padding: 0 34px 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background-color: rgba(20, 12, 36, 0.62);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23b3a5cf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  appearance: none;
  cursor: pointer;
  outline: none;
}

.sort select:focus-visible {
  border-color: rgba(232, 198, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 198, 106, 0.08);
}

.results-meta {
  min-height: 18px;
  margin: 4px 0 18px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.results-meta strong {
  color: var(--gold-soft);
  font-weight: 700;
}

.meta-ecchi {
  color: #ff9ec4;
}

.meta-hidden {
  color: var(--muted-2);
}

/* ------------------------------------------------------------------ */
/* Grid + cards                                                        */
/* ------------------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 26px 18px;
  padding-bottom: 10px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
  }
}

.card {
  --accent: var(--gold);
  --i: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: card-rise 0.55s cubic-bezier(0.22, 0.78, 0.3, 1) both;
  animation-delay: calc(min(var(--i), 12) * 24ms);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(154, 107, 240, 0.24), transparent 60%),
    linear-gradient(150deg, #1c1233, #120b24 60%, #160e2a);
  border: 1px solid rgba(214, 190, 255, 0.16);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.28s cubic-bezier(0.22, 0.78, 0.3, 1), border-color 0.28s ease, box-shadow 0.28s ease;
}

.card:hover .cover {
  transform: translateY(-5px);
  border-color: rgba(232, 198, 106, 0.45);
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(232, 198, 106, 0.12),
    0 0 34px rgba(232, 198, 106, 0.08);
}

.cover img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.55s cubic-bezier(0.22, 0.78, 0.3, 1), opacity 0.3s ease;
  background: #120b24;
}

.card:hover .cover img {
  transform: scale(1.045);
}

.cover.is-wide img {
  object-fit: contain;
  padding: 7%;
  background: transparent;
}

.cover.is-wide::before {
  content: "";
  position: absolute;
  inset: -14%;
  z-index: 0;
  background-image: var(--cover-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.48) saturate(0.9);
  transform: scale(1.06);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 3, 13, 0.34) 0%, transparent 26%, transparent 62%, rgba(6, 3, 13, 0.66) 100%);
}

.cover-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.cover.has-fallback .cover-fallback {
  display: grid;
}

.cover.has-fallback img {
  display: none;
}

.fallback-inner {
  display: grid;
  gap: 10px;
  justify-items: center;
  color: var(--accent);
}

.fallback-inner svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

.fallback-inner span {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.3;
  color: var(--muted);
  max-width: 130px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.cat-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 4, 16, 0.72);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.cat-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.date-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 18px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(8, 4, 16, 0.76);
  color: #d9d0ec;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(6px);
}

.score-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8e7ad, #e8c66a 55%, #c99a3f);
  color: #261804;
  box-shadow:
    0 5px 16px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.score-badge .star {
  width: 11px;
  height: 11px;
  align-self: center;
  margin-right: 1px;
}

.score-badge .den {
  font-size: 8.5px;
  font-weight: 700;
  opacity: 0.62;
}

.score-badge.unrated {
  background: rgba(8, 4, 16, 0.78);
  color: var(--muted-2);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.cover-corner {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: calc(100% - 14px);
}

.cover.has-ecchi .cover-corner {
  max-width: calc(100% - 56px);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 100%;
}

.ptag {
  --brand: #cbb6ff;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 4, 16, 0.78);
  color: #eee6ff;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.ptag svg {
  width: 10px;
  height: 10px;
  color: var(--brand);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 11px 2px 0;
}

.card-title {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.005em;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.card-note {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.link-btn svg {
  width: 9px;
  height: 9px;
  opacity: 0.7;
}

.link-btn:hover {
  color: #0b0616;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.link-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Empty state                                                         */
/* ------------------------------------------------------------------ */

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 58px 20px 70px;
  text-align: center;
}

.empty-icon {
  width: 60px;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 6px;
}

.empty-icon svg {
  width: 100%;
  height: auto;
}

.empty h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.empty p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(232, 198, 106, 0.35);
  background: linear-gradient(180deg, rgba(232, 198, 106, 0.16), rgba(232, 198, 106, 0.07));
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover {
  background: linear-gradient(180deg, rgba(232, 198, 106, 0.26), rgba(232, 198, 106, 0.12));
  border-color: rgba(232, 198, 106, 0.55);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.footer {
  padding: 62px 0 44px;
}

.footer-rule {
  height: 1px;
  margin-bottom: 28px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.footer-moon {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.11em;
  color: var(--muted-2);
}

.footer-moon em {
  color: var(--gold);
  font-style: normal;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.footer-row a {
  color: var(--muted-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.2s ease;
}

.footer-row a:hover {
  color: var(--gold-soft);
  border-color: rgba(232, 198, 106, 0.4);
}

/* ------------------------------------------------------------------ */
/* Focus + motion                                                      */
/* ------------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid rgba(232, 198, 106, 0.8);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 30px);
  }

  .hero {
    padding: 40px 0 20px;
  }

  .hero-copy {
    font-size: 12.5px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }

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

  .stat {
    min-width: 0;
    padding: 9px 10px 10px;
  }

  .stat b {
    font-size: 17px;
  }

  .stat span {
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .toolbar {
    align-items: stretch;
  }

  .search {
    flex-basis: 100%;
  }

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

  .filter-low,
  .filter-grid .filter-clear {
    grid-column: auto;
  }

  .filter-low {
    flex-wrap: wrap;
  }

  .sort {
    justify-content: space-between;
  }

  .sort select {
    flex: 1;
  }

  .footer-row {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .score-badge {
    top: 6px;
    right: 6px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .cat-pill {
    top: 6px;
    left: 6px;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
