/* GirlsX — Tokyo Night, dark only. Palette sampled from the logo and favicon. */
:root {
  --bg: #110e22;
  --surface: #1a1633;
  --surface-2: #241e47;
  --border: #362c6b;
  --ink: #c8cdf5;
  --muted: #8a8db8;
  --purple: #9a5cf5;
  --purple-2: #c08af5;
  --teal: #12f0c4;
  --navy: #0a1040;
  --radius: 12px;
  --shadow: 0 6px 24px rgb(10 16 64 / 0.55);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Components set display (grid/flex); [hidden] must still win, e.g. stale cards. */
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgb(154 92 245 / 0.16), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgb(18 240 196 / 0.07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple-2); text-decoration: none; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--teal); color: var(--navy); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px clamp(12px, 3vw, 32px);
  background: rgb(17 14 34 / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand img { display: block; width: 160px; height: auto; }
.quick-search { flex: 1 1 280px; display: flex; gap: 8px; max-width: 560px; }
.quick-search input, .search-form input, .search-form select {
  flex: 1; min-width: 0;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; font: inherit;
}
.search-form input, .search-form select { border-radius: 10px; width: 100%; }
.quick-search input::placeholder, .search-form input::placeholder { color: var(--muted); }
.top-nav { display: flex; gap: 6px; }
.top-nav a { padding: 8px 12px; border-radius: 999px; color: var(--ink); }
.top-nav a:hover { background: var(--surface-2); color: var(--teal); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms, color 160ms, box-shadow 160ms;
}
button:hover, .btn:hover { color: var(--teal); border-color: var(--teal); }
button:active, .btn:active { transform: scale(0.97); }
.quick-search button, .btn--primary {
  background: var(--teal); color: var(--navy); border-color: var(--teal);
  box-shadow: 0 0 0 0 rgb(18 240 196 / 0);
}
.quick-search button:hover, .btn--primary:hover { color: var(--navy); box-shadow: 0 0 18px rgb(18 240 196 / 0.45); }

/* Layout */
main { padding: 16px clamp(12px, 3vw, 32px) 48px; max-width: 1600px; margin: 0 auto; }
.page-title { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); margin: 12px 0 4px; color: #fff; letter-spacing: -0.01em; }
.page-title .count, .row__title .count { font-size: 0.55em; font-weight: 600; color: var(--teal); margin-left: 8px; vertical-align: middle; }
.intro { color: var(--muted); max-width: 70ch; margin: 0 0 16px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-top: 8px; }
.empty, .notice { padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.notice { border-color: var(--purple); margin: 12px 0; }
.row { margin: 28px 0; }
.row__title { font-size: 1.2rem; margin: 0 0 12px; color: #fff; }
.row__title a { color: #fff; }
.row__title a:hover { color: var(--teal); }
#featured .row__title::before { content: "★ "; color: var(--teal); }

.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 250px); gap: 14px;
  overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-color: var(--border) transparent;
}
.strip > .card { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* Cards */
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--ink);
  transition: transform 200ms var(--ease-out), border-color 200ms, box-shadow 200ms;
}
.card:hover { transform: translateY(-3px); border-color: var(--purple); box-shadow: var(--shadow), 0 0 0 1px rgb(154 92 245 / 0.35); color: var(--ink); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge--live { left: 8px; background: var(--teal); color: var(--navy); }
.badge--live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--navy);
  margin-right: 5px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite;
}
.badge--hd { right: 8px; background: rgb(17 14 34 / 0.8); color: var(--purple-2); border: 1px solid var(--purple); }
.badge--new { right: 8px; top: 34px; background: var(--purple-2); color: var(--navy); }
.badge--hd + .badge--new { top: 34px; }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.card__name { font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__age { color: var(--purple-2); font-weight: 600; }
.card__subject { color: var(--muted); font-size: 0.86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card__stats { font-size: 0.82rem; color: var(--teal); }
.card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 0.75rem; color: var(--purple-2); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Search */
.search-form {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; align-items: end;
  padding: 16px; margin: 12px 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.field--wide { grid-column: 1 / -1; }
.field--pair { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
.field--pair label { flex-basis: 100%; }
.field--pair input { flex: 1; }
.field--checks { flex-direction: row; gap: 16px; align-items: center; }
.field--checks label { display: flex; gap: 6px; align-items: center; color: var(--ink); }
.field--checks input { accent-color: var(--teal); width: auto; }
.field--actions { flex-direction: row; gap: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: var(--surface-2); border: 1px solid var(--purple); color: var(--ink); padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 28px clamp(12px, 3vw, 32px) 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; color: var(--muted);
  background: rgb(10 16 64 / 0.25);
}
.site-footer h2 { font-size: 0.95rem; color: #fff; margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; columns: 2; font-size: 0.88rem; }
.site-footer li { margin: 3px 0; }
.legal { grid-column: 1 / -1; margin: 0; font-size: 0.82rem; }

/* Legal/prose */
.prose { max-width: 72ch; }
.draft-banner { background: rgb(18 240 196 / 0.1); border: 1px dashed var(--teal); color: var(--teal); padding: 8px 12px; border-radius: 8px; }

/* Entrance terms (first visit) */
#entrance_terms_overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgb(10 8 24 / 0.94); backdrop-filter: blur(14px);
}
.ag-ok #entrance_terms_overlay { display: none; }
body.entrance-terms--shown, html:not(.ag-ok) body { overflow: hidden; }
#entrance_terms {
  display: flex; flex-direction: column; width: min(760px, 100%); max-height: calc(100vh - 32px);
  background: var(--surface); border: 1px solid var(--purple); border-radius: 18px;
  box-shadow: var(--shadow), 0 0 40px rgb(154 92 245 / 0.25); animation: card-in 320ms var(--ease-out) both;
}
#entrance_terms .header { padding: 18px 22px 6px; color: #fff; text-align: center; }
#entrance_terms .header p { margin: 0; letter-spacing: 0.02em; }
#entrance_terms .scroll {
  overflow-y: auto; padding: 4px 22px 12px; color: var(--ink); font-size: 0.86rem; line-height: 1.5;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); outline: none;
}
#entrance_terms .scroll ul { padding-left: 20px; }
#entrance_terms .scroll li { margin: 6px 0; }
#entrance_terms .esignature_container { margin: 10px 0 4px; color: var(--muted); }
#entrance_terms .esignature { display: inline-block; min-width: 180px; text-align: center; border-bottom: 1px solid var(--ink); color: #fff; }
#entrance_terms .law-enforcement { color: #ff5c7a; font-weight: 700; font-size: 11px; padding: 10px 22px 0; margin: 0; }
#entrance_terms .footer { display: flex; gap: 12px; justify-content: flex-end; align-items: center; padding: 14px 22px 18px; }
#entrance_terms .exit_entrance_terms { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); color: var(--ink); }
#entrance_terms .exit_entrance_terms:hover { border-color: var(--teal); color: var(--teal); }
#close_entrance_terms { background: var(--teal); color: var(--navy); border-color: var(--teal); font-weight: 800; letter-spacing: 0.04em; }
#close_entrance_terms:hover { color: var(--navy); box-shadow: 0 0 18px rgb(18 240 196 / 0.45); }

.more-sentinel { height: 1px; }

@media (max-width: 640px) {
  .brand img { width: 120px; }
  .top-nav { width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .strip { grid-auto-columns: minmax(170px, 190px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
