:root {
  --bg: #090b24;
  --bg-soft: #11143d;
  --panel: rgba(19, 22, 61, 0.78);
  --panel-solid: #151943;
  --text: #f7f5ff;
  --muted: #b8b6d4;
  --line: rgba(255, 255, 255, 0.1);
  --purple: #8a68ff;
  --purple-light: #b59cff;
  --blue: #4c8dff;
  --success: #55d6a5;
  --warning: #f5bf69;
  --danger: #ff6f91;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(84, 60, 185, 0.28), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(36, 89, 198, 0.22), transparent 30%),
    linear-gradient(180deg, #080a20 0%, #0d1030 100%);
  overflow-x: hidden;
}

button, input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

.background-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .2;
  pointer-events: none;
  z-index: -1;
}
.background-orb-one { background: #844dff; top: 18%; left: -220px; }
.background-orb-two { background: #245dff; right: -220px; bottom: 8%; }

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand-logo-wrap {
  width: 68px;
  height: 68px;
  padding: 5px;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(27, 17, 89, .35);
}
.brand-logo { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); margin-top: 4px; }
.brand-centered { justify-content: center; margin-bottom: 24px; }
.admin-link, .text-link {
  color: var(--purple-light);
  text-decoration: none;
  font-weight: 700;
}
.admin-link:hover, .text-link:hover { color: #fff; }

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 80px;
}
.glass-panel {
  background: linear-gradient(145deg, rgba(32, 35, 89, .87), rgba(16, 19, 56, .75));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.hero {
  border-radius: 32px;
  padding: clamp(28px, 6vw, 64px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "✦";
  position: absolute;
  right: 34px;
  top: 20px;
  font-size: 3rem;
  color: rgba(181, 156, 255, .28);
}
.eyebrow {
  display: inline-block;
  color: var(--purple-light);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
h1, h2, h3, p { margin-top: 0; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.35rem);
  line-height: .98;
  letter-spacing: -.055em;
  margin-bottom: 22px;
  max-width: 750px;
}
.hero-copy p { color: var(--muted); font-size: 1.08rem; line-height: 1.7; max-width: 630px; margin-bottom: 0; }
.search-box {
  padding: 24px;
  border-radius: 24px;
  background: rgba(8, 10, 34, .58);
  border: 1px solid var(--line);
}
.search-box label, .stack-form label { display: block; font-weight: 800; margin-bottom: 9px; }
.search-input-row { position: relative; }
input {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, .065);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 4px rgba(138, 104, 255, .15);
  background: rgba(255, 255, 255, .09);
}
input::placeholder { color: #8987a9; }
.pseudo-row { margin-top: 18px; }
.pseudo-row label span { color: var(--muted); font-weight: 500; }
.form-note { color: var(--muted); font-size: .82rem; line-height: 1.5; margin: 10px 0 0; }
.spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--purple-light);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.content-section { padding-top: 56px; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}
.section-heading h2, .admin-topbar h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -.04em; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stats span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  color: var(--muted);
}
.stats strong { color: #fff; }

.anime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.anime-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(29, 33, 82, .94), rgba(18, 21, 61, .94));
  border: 1px solid var(--line);
  box-shadow: 0 16px 45px rgba(0,0,0,.22);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.anime-card:hover { transform: translateY(-4px); border-color: rgba(181,156,255,.45); box-shadow: 0 22px 55px rgba(0,0,0,.3); }
.cover-wrap { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #0b0d2a; }
.cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.anime-card:hover .cover-wrap img { transform: scale(1.025); }
.country-pill, .status-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.18);
}
.country-pill { background: rgba(10, 12, 42, .82); }
.status-badge.pending { background: rgba(67, 61, 126, .9); }
.status-badge.review { background: rgba(129, 87, 26, .9); }
.status-badge.available { background: rgba(25, 112, 82, .9); }
.anime-card-body { padding: 18px; }
.anime-meta { color: var(--purple-light); font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.anime-card h3 { font-size: 1.1rem; line-height: 1.25; margin-bottom: 8px; }
.alternate-title { color: var(--muted); font-size: .86rem; line-height: 1.4; min-height: 2.4em; margin-bottom: 14px; }
.support-summary {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 14px 0;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.support-summary strong { font-size: 1.2rem; }
.support-summary span { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.available-note {
  color: var(--success);
  background: rgba(85, 214, 165, .09);
  border: 1px solid rgba(85, 214, 165, .2);
  border-radius: 12px;
  padding: 11px;
  font-size: .82rem;
  line-height: 1.4;
}
.is-available { border-color: rgba(85,214,165,.35); }

.button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--purple), var(--blue)); box-shadow: 0 10px 25px rgba(89, 78, 219, .28); }
.button-secondary { background: rgba(138, 104, 255, .15); border: 1px solid rgba(181,156,255,.3); color: #ded3ff; }
.button-ghost { background: rgba(255,255,255,.055); border: 1px solid var(--line); }
.button-success { background: rgba(45, 161, 118, .9); }
.button-warning { background: rgba(184, 124, 34, .9); }
.button-danger { background: rgba(192, 62, 90, .95); }
.button-danger-outline { background: transparent; border: 1px solid rgba(255,111,145,.5); color: #ffabc0; }
.button-full { width: 100%; }
.button-small { padding: 9px 12px; font-size: .82rem; }

.empty-state, .loading-card, .error-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
  border: 1px dashed rgba(255,255,255,.16);
  color: var(--muted);
}
.empty-state.compact { padding: 30px 20px; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 0; }
.empty-icon { font-size: 2rem; color: var(--purple-light); margin-bottom: 8px; }
.error-card { color: #ffc1ce; border-color: rgba(255,111,145,.3); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100% - 48px));
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 750;
}
.toast-success { background: #176448; }
.toast-error { background: #7b2940; }
.flash-stack { position: fixed; top: 20px; right: 20px; z-index: 100; display: grid; gap: 10px; }
.flash { padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 420px; }
.flash-success { background: #176448; }
.flash-error { background: #7b2940; }

.centered-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); padding: 34px; border-radius: 28px; text-align: center; }
.login-card h1 { font-size: 1.8rem; margin-bottom: 24px; }
.stack-form { display: grid; gap: 18px; text-align: left; margin-bottom: 20px; }

.admin-shell { padding-top: 22px; }
.admin-header { padding-bottom: 10px; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.header-actions form { margin: 0; }
.admin-topbar { display: flex; justify-content: space-between; gap: 22px; align-items: end; margin-bottom: 24px; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { padding: 20px; border-radius: 18px; background: rgba(255,255,255,.055); border: 1px solid var(--line); }
.stat-card span { color: var(--muted); display: block; margin-bottom: 8px; }
.stat-card strong { font-size: 2rem; }
.admin-list { display: grid; gap: 16px; }
.admin-request-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 16px; background: rgba(21,25,67,.9); border: 1px solid var(--line); border-radius: 20px; }
.admin-cover { width: 120px; height: 170px; border-radius: 14px; object-fit: cover; background: #fff; }
.admin-request-title-row { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.admin-request-title-row h2 { margin-bottom: 6px; font-size: 1.35rem; }
.admin-request-title-row p { color: var(--muted); margin-bottom: 0; }
.status { font-size: .72rem; font-weight: 900; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); }
.status-pending { color: var(--purple-light); }
.status-review { color: var(--warning); }
.status-available { color: var(--success); }
.status-rejected { color: var(--danger); }
.admin-meta-grid { display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--muted); font-size: .85rem; margin: 16px 0; }
.admin-pseudos { color: var(--muted); font-size: .9rem; }
.review-box { padding: 12px; border-radius: 12px; background: rgba(245,191,105,.08); border: 1px solid rgba(245,191,105,.2); color: #f5d39c; margin-bottom: 14px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; }
  .anime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .site-header, .section-heading, .admin-topbar { align-items: flex-start; }
  .site-header, .admin-topbar { flex-direction: column; }
  .anime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-request-card { grid-template-columns: 88px 1fr; }
  .admin-cover { width: 88px; height: 130px; }
  .admin-request-title-row { flex-direction: column; gap: 10px; }
}
@media (max-width: 520px) {
  .page-shell, .site-header { width: min(100% - 20px, 1180px); }
  .hero { border-radius: 22px; padding: 24px 18px; }
  .hero h1 { font-size: 2.35rem; }
  .anime-grid { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; align-items: flex-start; }
  .brand-logo-wrap { width: 58px; height: 58px; }
  .admin-request-card { grid-template-columns: 1fr; }
  .admin-cover { width: 100%; height: 260px; }
}
