/* =========================================================
   1. THEME TOKENS AND BASE RESET
   ========================================================= */
:root {
  --bg: #090810;
  --bg-soft: #0f0d18;
  --surface: rgba(20, 18, 31, 0.82);
  --surface-solid: #15121f;
  --surface-raised: #1c1828;
  --border: rgba(255, 255, 255, 0.09);
  --border-bright: rgba(169, 123, 255, 0.35);
  --text: #f7f4ff;
  --muted: #9f9aac;
  --muted-bright: #c9c4d3;
  --purple: #a97bff;
  --purple-deep: #7650d9;
  --pink: #ff6ea9;
  --cyan: #61dafb;
  --gold: #ffc857;
  --green: #54d6a0;
  --red: #ff6b7a;
  --amber: #ffb85c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body::selection {
  color: #150e24;
  background: var(--purple);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   2. ATMOSPHERIC BACKGROUND
   ========================================================= */
.background-effects {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.16;
}

.orb-one {
  top: -180px;
  right: -120px;
  width: 560px;
  height: 560px;
  background: var(--purple);
}

.orb-two {
  top: 55%;
  left: -240px;
  width: 520px;
  height: 520px;
  background: var(--pink);
}

.grid-lines {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

/* =========================================================
   3. HEADER AND NAVIGATION
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(9, 8, 16, 0.78);
  backdrop-filter: blur(20px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--purple), var(--purple-deep));
  box-shadow: 0 10px 28px rgba(118, 80, 217, 0.36);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 25px;
  stroke-width: 2.2;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: var(--muted);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-link svg {
  width: 18px;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: white;
  background: rgba(169, 123, 255, 0.16);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--text);
  transition: transform 180ms ease, opacity 180ms ease;
}

/* =========================================================
   4. SHARED BUTTONS AND LABELS
   ========================================================= */
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button svg {
  width: 19px;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--purple), #855fea);
  box-shadow: 0 12px 28px rgba(118, 80, 217, 0.28);
}

.button-primary:hover {
  box-shadow: 0 16px 38px rgba(118, 80, 217, 0.4);
}

.button-secondary,
.button-ghost {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: rgba(169, 123, 255, 0.42);
  background: rgba(169, 123, 255, 0.08);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-bright);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(84, 214, 160, 0.1);
  animation: pulse 2s infinite;
}

.pulse-dot.amber {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(255, 184, 92, 0.1);
}

.eyebrow-text {
  display: block;
  margin-bottom: 4px;
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

/* =========================================================
   5. PUBLIC HERO
   ========================================================= */
.app-view {
  animation: view-enter 380ms ease both;
}

.hero {
  display: grid;
  min-height: 545px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 60px;
  padding: 82px 0 62px;
}

.hero-copy h1,
.admin-hero h1 {
  margin: 16px 0 20px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(3rem, 6vw, 5.45rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy h1 span {
  color: transparent;
  background: linear-gradient(90deg, var(--purple), var(--pink) 68%, var(--gold));
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-copy > p {
  max-width: 600px;
  color: var(--muted-bright);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-visual {
  position: relative;
  min-height: 370px;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(169, 123, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-large {
  width: 340px;
  height: 340px;
  animation: spin 24s linear infinite;
}

.orbit-large::before,
.orbit-small::before {
  position: absolute;
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 16px var(--pink);
}

.orbit-large::before {
  top: 55px;
  right: 30px;
}

.orbit-small {
  width: 260px;
  height: 260px;
  border-style: dashed;
  animation: spin-reverse 18s linear infinite;
}

.orbit-small::before {
  bottom: 20px;
  left: 62px;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.hero-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(155deg, rgba(39, 31, 57, 0.95), rgba(18, 15, 28, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card-main {
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 230px;
  min-height: 285px;
  padding: 28px;
  border-radius: 25px;
  transform: translate(-50%, -50%) rotate(4deg);
  animation: float 5s ease-in-out infinite;
}

.hero-card-main::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  background: radial-gradient(circle at 80% 10%, rgba(255, 110, 169, 0.24), transparent 40%);
  pointer-events: none;
}

.hero-card-icon {
  display: grid;
  width: 55px;
  height: 55px;
  margin-bottom: 50px;
  place-items: center;
  color: #1a1126;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  font-size: 1.5rem;
  box-shadow: 0 10px 28px rgba(255, 110, 169, 0.25);
}

.hero-card span {
  display: block;
  color: var(--purple);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.hero-card strong {
  display: block;
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.mini-progress {
  height: 5px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-progress span {
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

.hero-card-back {
  right: 2%;
  bottom: 7%;
  z-index: 3;
  width: 150px;
  padding: 18px;
  border-radius: 18px;
  transform: rotate(-7deg);
}

.hero-card-back strong {
  color: var(--gold);
  font-size: 2rem;
}

.hero-card-back small {
  color: var(--muted);
}

.spark {
  position: absolute;
  color: var(--purple);
  font-size: 2rem;
  animation: sparkle 3s ease-in-out infinite;
}

.spark-one {
  top: 8%;
  right: 8%;
}

.spark-two {
  bottom: 8%;
  left: 4%;
  color: var(--pink);
  animation-delay: 1s;
}

/* =========================================================
   6. STATISTICS
   ========================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 96px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, border-color 180ms ease;
}

.stat-card:hover {
  border-color: rgba(169, 123, 255, 0.28);
  transform: translateY(-3px);
}

.stat-icon {
  display: grid;
  flex: 0 0 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
}

.stat-icon svg {
  width: 21px;
}

.stat-icon.purple { color: var(--purple); background: rgba(169, 123, 255, 0.12); }
.stat-icon.cyan { color: var(--cyan); background: rgba(97, 218, 251, 0.1); }
.stat-icon.pink { color: var(--pink); background: rgba(255, 110, 169, 0.1); }
.stat-icon.gold { color: var(--gold); background: rgba(255, 200, 87, 0.1); }

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
  line-height: 1.1;
}

.stat-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* =========================================================
   7. COLLECTION FILTERS
   ========================================================= */
.collection-section,
.manage-section {
  padding-bottom: 100px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.section-heading h2,
.card-heading h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  letter-spacing: -0.035em;
}

.section-heading > p {
  color: var(--muted);
  font-size: 0.86rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 18px 25px;
  padding: 19px;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.search-field {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 15px;
  width: 19px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  height: 100%;
  padding: 11px 46px;
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  border-radius: 12px;
  background: rgba(7, 6, 12, 0.58);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-field input:focus {
  border-color: rgba(169, 123, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(169, 123, 255, 0.09);
}

.search-field kbd {
  position: absolute;
  right: 13px;
  padding: 2px 7px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: rgba(169, 123, 255, 0.34);
}

.filter-chip.active {
  color: white;
  border-color: rgba(169, 123, 255, 0.38);
  background: rgba(169, 123, 255, 0.14);
}

.sort-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.sort-row > label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  border-radius: 10px;
  background: #100e18;
  appearance: none;
}

.sort-row .select-wrap select {
  min-width: 190px;
  padding: 8px 34px 8px 11px;
  font-size: 0.8rem;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 16px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.text-button {
  margin-left: auto;
  padding: 6px;
  color: var(--purple);
  border: 0;
  background: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: #c3a6ff;
}

/* =========================================================
   8. ANIME CARDS
   ========================================================= */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.anime-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(27, 23, 39, 0.96), rgba(16, 14, 24, 0.98));
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  animation: card-enter 420ms ease both;
}

.anime-card:hover {
  border-color: rgba(169, 123, 255, 0.32);
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.3);
  transform: translateY(-6px);
}

.anime-card.favorite {
  border-color: rgba(255, 200, 87, 0.25);
}

.cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #191525;
}

.cover-wrap::after {
  position: absolute;
  inset: 40% 0 0;
  content: "";
  background: linear-gradient(to bottom, transparent, rgba(15, 13, 22, 0.88));
  pointer-events: none;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2, .7, .2, 1);
}

.anime-card:hover .cover-image {
  transform: scale(1.045);
}

.status-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(9, 8, 16, 0.76);
  backdrop-filter: blur(12px);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.status-watching { color: var(--cyan); }
.status-completed { color: var(--green); }
.status-on-hold { color: var(--amber); }
.status-dropped { color: var(--red); }
.status-plan-to-watch { color: var(--purple); }

.favorite-badge {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: 50%;
  background: rgba(9, 8, 16, 0.78);
  backdrop-filter: blur(12px);
}

.favorite-badge svg {
  width: 16px;
  fill: currentColor;
}

.card-content {
  padding: 20px;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.anime-card h3 {
  overflow: hidden;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.16rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.rating svg {
  width: 14px;
  fill: currentColor;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.75rem;
}

.progress-copy strong {
  color: var(--muted-bright);
  font-weight: 700;
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.genre-tag {
  padding: 4px 8px;
  color: var(--muted-bright);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.65rem;
  font-weight: 600;
}

.anime-notes {
  display: -webkit-box;
  min-height: 43px;
  margin-top: 15px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed rgba(169, 123, 255, 0.26);
  border-radius: var(--radius-lg);
  background: rgba(169, 123, 255, 0.035);
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  color: var(--purple);
  border: 1px solid rgba(169, 123, 255, 0.3);
  border-radius: 18px;
  background: rgba(169, 123, 255, 0.1);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.empty-state h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
}

.empty-state p {
  margin: 5px 0 20px;
  color: var(--muted);
}

/* =========================================================
   9. ADMIN AREA
   ========================================================= */
.admin-container {
  padding-top: 70px;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.admin-hero h1 {
  margin: 12px 0 6px;
  font-size: clamp(2.7rem, 6vw, 4.5rem);
}

.admin-hero p {
  color: var(--muted-bright);
}

.security-notice {
  display: flex;
  gap: 15px;
  padding: 18px;
  margin-bottom: 24px;
  color: #f5d8aa;
  border: 1px solid rgba(255, 184, 92, 0.25);
  border-radius: var(--radius-md);
  background: rgba(255, 184, 92, 0.065);
}

.notice-icon {
  display: grid;
  flex: 0 0 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 184, 92, 0.12);
}

.notice-icon svg {
  width: 20px;
}

.security-notice p {
  margin-top: 3px;
  color: #c9b99f;
  font-size: 0.82rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 22px;
  margin-bottom: 80px;
}

.form-card,
.preview-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.card-heading.compact {
  margin-bottom: 18px;
}

.card-heading h2 {
  font-size: 1.55rem;
}

.edit-badge {
  padding: 5px 10px;
  color: var(--gold);
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: 999px;
  background: rgba(255, 200, 87, 0.08);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.full-width {
  grid-column: 1 / -1;
}

.form-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-bright);
  font-size: 0.78rem;
  font-weight: 700;
}

.form-field b {
  color: var(--pink);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  border-radius: 11px;
  background: rgba(7, 6, 12, 0.58);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-field input,
.form-field select {
  min-height: 45px;
  padding: 10px 12px;
}

.form-field select {
  padding-right: 36px;
}

.form-field textarea {
  min-height: 105px;
  padding: 11px 12px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: rgba(169, 123, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(169, 123, 255, 0.08);
}

.form-field small {
  display: block;
  margin-top: 6px;
  color: #777184;
  font-size: 0.68rem;
}

.favorite-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.favorite-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-box {
  position: relative;
  width: 41px;
  height: 23px;
  border-radius: 999px;
  background: #302b3c;
  transition: background 180ms ease;
}

.toggle-box span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: white;
  transition: transform 180ms ease;
}

.favorite-toggle input:checked + .toggle-box {
  background: var(--purple);
}

.favorite-toggle input:checked + .toggle-box span {
  transform: translateX(18px);
}

.favorite-toggle strong,
.favorite-toggle small {
  display: block;
}

.favorite-toggle strong {
  font-size: 0.8rem;
}

.favorite-toggle small {
  color: var(--muted);
  font-size: 0.68rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.admin-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.preview-card .anime-card {
  max-width: 340px;
  margin-inline: auto;
}

.future-card {
  display: flex;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(97, 218, 251, 0.14);
  border-radius: var(--radius-md);
  background: rgba(97, 218, 251, 0.04);
}

.future-icon {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  color: var(--cyan);
  border-radius: 11px;
  background: rgba(97, 218, 251, 0.08);
}

.future-icon svg {
  width: 19px;
}

.future-card strong {
  font-size: 0.82rem;
}

.future-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.manage-list {
  display: grid;
  gap: 10px;
}

.manage-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 180ms ease, transform 180ms ease;
}

.manage-item:hover {
  border-color: rgba(169, 123, 255, 0.24);
  transform: translateX(3px);
}

.manage-cover {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-raised);
}

.manage-title {
  min-width: 0;
}

.manage-title strong,
.manage-title span {
  display: block;
}

.manage-title strong {
  overflow: hidden;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-title span {
  color: var(--muted);
  font-size: 0.7rem;
}

.manage-progress {
  color: var(--muted-bright);
  font-size: 0.75rem;
  font-weight: 700;
}

.item-actions {
  display: flex;
  gap: 7px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted-bright);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button svg {
  width: 16px;
}

.icon-button:hover {
  color: var(--purple);
  border-color: rgba(169, 123, 255, 0.35);
  background: rgba(169, 123, 255, 0.08);
}

.icon-button.danger:hover {
  color: var(--red);
  border-color: rgba(255, 107, 122, 0.32);
  background: rgba(255, 107, 122, 0.08);
}

/* =========================================================
   10. FOOTER AND TOAST
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(5, 5, 9, 0.45);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer-inner p {
  color: var(--muted);
  font-size: 0.75rem;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  border: 1px solid rgba(84, 214, 160, 0.25);
  border-radius: 12px;
  background: rgba(18, 31, 27, 0.95);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #092016;
  border-radius: 50%;
  background: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
}

/* =========================================================
   11. ANIMATION AND RESPONSIVE DESIGN
   ========================================================= */
@keyframes pulse {
  50% { box-shadow: 0 0 0 9px rgba(84, 214, 160, 0); }
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-reverse {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) rotate(4deg); }
  50% { transform: translate(-50%, calc(-50% - 10px)) rotate(2deg); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0); }
  50% { opacity: 1; transform: scale(1.2) rotate(25deg); }
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 1020px) {
  .hero {
    grid-template-columns: 1fr 0.75fr;
    gap: 24px;
  }

  .hero-card-back {
    right: -3%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-side {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) 1fr;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .navbar {
    min-height: 70px;
  }

  .brand-subtitle {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .menu-toggle.open span:nth-child(2) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle.open span:nth-child(3) {
    opacity: 0;
  }

  .menu-toggle.open span:nth-child(4) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 9px);
    right: 14px;
    left: 14px;
    display: none;
    padding: 8px;
    border-radius: 14px;
    background: rgba(17, 15, 25, 0.98);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: grid;
  }

  .nav-link {
    justify-content: center;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 68px 0 30px;
    text-align: center;
  }

  .hero-copy > p {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    min-height: 335px;
    margin-top: 5px;
  }

  .stats-grid {
    margin-bottom: 72px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .status-filters {
    flex-wrap: nowrap;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .status-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .sort-row {
    flex-wrap: wrap;
  }

  .text-button {
    margin-left: 0;
  }

  .admin-hero {
    align-items: start;
    flex-direction: column;
  }

  .admin-side {
    display: flex;
  }

  .form-card,
  .preview-card {
    padding: 21px;
  }

  .manage-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .manage-cover {
    width: 48px;
    height: 48px;
  }

  .manage-progress {
    display: none;
  }
}

@media (max-width: 540px) {
  .hero-copy h1 {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }

  .hero-copy > p {
    font-size: 0.96rem;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .hero-card-main {
    width: 205px;
    min-height: 255px;
  }

  .hero-card-icon {
    margin-bottom: 36px;
  }

  .orbit-large {
    width: 300px;
    height: 300px;
  }

  .orbit-small {
    width: 230px;
    height: 230px;
  }

  .hero-card-back {
    right: 0;
    width: 130px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

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

  .filter-panel {
    padding: 14px;
  }

  .sort-row .select-wrap {
    flex: 1;
  }

  .sort-row .select-wrap select {
    min-width: 0;
  }

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

  .form-grid > * {
    grid-column: 1;
  }

  .form-actions {
    flex-direction: column;
  }

  .security-notice {
    align-items: start;
  }

  .manage-item {
    gap: 10px;
  }

  .footer-inner {
    align-items: start;
    flex-direction: column;
  }

  .footer-note {
    text-align: left;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }
}

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