:root {
  --purple: #ff7ca2;
  --purple-bright: #ffb4cb;
  --blue: #79dfdc;
  --tier-s: #ff5c7a;
  --tier-a: #ff7e58;
  --tier-b: #ffab43;
  --tier-c: #ffd84f;
  --tier-d: #c8df55;
  --tier-f: #65d58a;
  --tier-g: #43d3c4;
  --tier-h: #4ca3f4;
  --tier-i: #9e7ff4;
  --tier-j: #a29ca8;
}

.anime-app {
  background:
    radial-gradient(circle at 75% -10%, rgba(255, 111, 155, 0.12), transparent 32%),
    radial-gradient(circle at -10% 55%, rgba(76, 188, 201, 0.08), transparent 30%),
    linear-gradient(180deg, #0d0c12 0%, #0b0a0f 100%);
}

.anime-app .ambient-one {
  background: #ff547f;
}

.anime-app .ambient-two {
  background: #26b7c7;
}

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

.anime-app .brand strong span {
  color: #ff8fae;
}

.anime-app .eyebrow {
  color: #ffabc2;
}

.anime-app .eyebrow::before {
  background: #ff7ca2;
}

.bangumi-login-button {
  display: inline-flex;
  gap: 8px;
  height: 36px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #3b3543;
  border-radius: 9px;
  color: #d8d0de;
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.bangumi-login-button span {
  padding: 2px 5px;
  border-radius: 4px;
  color: #89e5dd;
  background: rgba(67, 211, 196, 0.1);
  font-size: 7px;
}

.bangumi-login-button:hover {
  border-color: #645467;
  background: #1c1921;
}

.anime-dashboard {
  max-width: 1400px;
  padding-top: 46px;
}

.anime-dashboard-heading h1 {
  font-size: clamp(38px, 4.5vw, 58px);
}

.anime-guest-note {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(121, 223, 220, 0.18);
  border-radius: 11px;
  background:
    linear-gradient(90deg, rgba(67, 211, 196, 0.07), transparent 50%),
    rgba(255, 255, 255, 0.018);
}

.anime-guest-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  color: #ffe0e9;
  background: linear-gradient(145deg, #ff7299, #d2537c);
  box-shadow: 0 8px 18px rgba(255, 92, 122, 0.16);
}

.anime-guest-note > div {
  min-width: 0;
  flex: 1;
}

.anime-guest-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
}

.anime-guest-note p {
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}

.anime-guest-note button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #34303b;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.anime-guest-note button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.anime-stats-row .stat-icon {
  color: #87e3dc;
  background: rgba(67, 211, 196, 0.075);
}

.anime-year-select {
  display: flex;
  gap: 7px;
  height: 30px;
  align-items: center;
  padding: 0 5px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
  font-weight: 700;
}

.anime-year-select select {
  height: 24px;
  border: 0;
  outline: none;
  color: var(--purple-bright);
  background: transparent;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.anime-library-shell {
  overflow: visible;
}

.anime-library-heading {
  align-items: center;
}

.anime-search-area {
  position: relative;
  padding: 0 20px 16px;
}

.anime-format-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}

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

.anime-format-tabs button {
  height: 30px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #332d39;
  border-radius: 99px;
  color: #8d8395;
  background: #151219;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.anime-format-tabs button:hover {
  border-color: #5c4d61;
  color: #d8cedd;
}

.anime-format-tabs button.is-active {
  border-color: rgba(255, 124, 162, 0.56);
  color: #ffd5e1;
  background:
    linear-gradient(135deg, rgba(255, 124, 162, 0.16), rgba(67, 211, 196, 0.06)),
    #1c1720;
  box-shadow: 0 0 18px rgba(255, 124, 162, 0.07);
}

.anime-main-search {
  display: flex;
  gap: 11px;
  height: 52px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid #423947;
  border-radius: 12px;
  background: #100f14;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.anime-main-search:focus-within {
  border-color: rgba(255, 124, 162, 0.62);
  box-shadow:
    0 0 0 4px rgba(255, 124, 162, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.anime-main-search svg {
  width: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: #8f8598;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.anime-main-search input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.anime-main-search input::placeholder {
  color: #625b69;
}

.anime-search-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #3f3746;
  border-top-color: #ff9fba;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.anime-search-status {
  min-height: 15px;
  margin: 6px 2px 0;
  color: #6e6677;
  font-size: 9px;
}

.anime-search-status.error {
  color: #ffaaa4;
}

.anime-search-results {
  position: absolute;
  z-index: 15;
  top: 88px;
  right: 20px;
  left: 20px;
  display: grid;
  max-height: 390px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #403746;
  border-radius: 12px;
  background: rgba(20, 17, 25, 0.98);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(18px);
}

.anime-search-result {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px;
  border: 1px solid #332d39;
  border-radius: 9px;
  color: var(--text);
  background: #1b1820;
  text-align: left;
  cursor: pointer;
}

.anime-search-result:hover {
  border-color: #6c5266;
  background: #221d28;
}

.anime-search-result img {
  width: 88px;
  height: 118px;
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(255, 124, 162, 0.22), rgba(67, 211, 196, 0.08)),
    #2b2430;
  object-fit: cover;
}

.anime-search-result-copy {
  min-width: 0;
}

.anime-search-result-copy strong {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.anime-search-result-copy small {
  color: #8c8294;
  font-size: 8px;
}

.low-rating-count {
  display: block;
  width: fit-content;
  margin: 2px 0 0;
  padding: 0 2px;
  border: 1px solid rgba(255, 175, 69, 0.3);
  border-radius: 4px;
  color: #ffc97d;
  background: rgba(255, 175, 69, 0.07);
  font-size: 5.5px;
  font-weight: 750;
  line-height: 1.5;
  vertical-align: middle;
}

.anime-search-result-action {
  padding: 6px 8px;
  border: 1px solid rgba(255, 124, 162, 0.34);
  border-radius: 6px;
  color: #ffc0d2;
  background: rgba(255, 124, 162, 0.055);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.anime-search-result.added {
  opacity: 0.55;
}

.anime-search-result.added .anime-search-result-action {
  border-color: #3b3640;
  color: #8a818f;
  background: transparent;
}

.bangumi-catalog {
  margin: 4px 20px 20px;
  overflow: hidden;
  border: 1px solid #302a36;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 124, 162, 0.035), transparent 30%),
    #141219;
}

.catalog-heading {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #2d2832;
}

.catalog-kicker {
  color: #ff91b1;
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.catalog-heading h3 {
  margin: 5px 0 3px;
  font-size: 15px;
}

.catalog-heading p {
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
}

.catalog-filters {
  display: flex;
  gap: 8px;
}

.catalog-add-page {
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 124, 162, 0.34);
  border-radius: 8px;
  color: #ffbdd0;
  background: rgba(255, 124, 162, 0.055);
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}

.catalog-add-page:hover {
  background: rgba(255, 124, 162, 0.12);
}

.catalog-filters label {
  display: flex;
  gap: 6px;
  height: 34px;
  align-items: center;
  padding-left: 9px;
  border: 1px solid #3a323f;
  border-radius: 8px;
  color: var(--muted-2);
  background: #19161e;
  font-size: 8px;
  font-weight: 700;
}

.catalog-filters select {
  height: 100%;
  padding: 0 22px 0 2px;
  border: 0;
  outline: none;
  color: #e4dbe8;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.catalog-custom-years {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #2d2832;
  color: #8d8395;
  font-size: 8px;
  font-weight: 700;
}

.catalog-custom-years input {
  width: 82px;
  height: 31px;
  padding: 0 8px;
  border: 1px solid #3a323f;
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: #19161e;
  font-size: 9px;
}

.catalog-custom-years input:focus {
  border-color: rgba(255, 124, 162, 0.5);
}

.catalog-custom-years button {
  height: 31px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid rgba(255, 124, 162, 0.34);
  border-radius: 7px;
  color: #ffbdd0;
  background: rgba(255, 124, 162, 0.055);
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}

.catalog-anime-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px;
  border: 1px solid #302a36;
  border-radius: 8px;
  background: #1c1821;
}

.catalog-anime-card img {
  width: 54px;
  height: 72px;
  border-radius: 5px;
  background: linear-gradient(145deg, #49364d, #263b3e);
  object-fit: cover;
}

.catalog-card-copy {
  min-width: 0;
}

.catalog-card-copy strong {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 9.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-card-copy small {
  display: block;
  overflow: hidden;
  color: #857a8c;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-add-button {
  width: 100%;
  height: 25px;
  margin-top: 7px;
  border: 1px solid rgba(255, 124, 162, 0.32);
  border-radius: 5px;
  color: #ffbdd0;
  background: rgba(255, 124, 162, 0.055);
  font-size: 7px;
  font-weight: 800;
  cursor: pointer;
}

.catalog-add-button:hover {
  background: rgba(255, 124, 162, 0.12);
}

.catalog-add-button.added {
  border-color: #37313c;
  color: #79717f;
  background: transparent;
  cursor: default;
}

.catalog-anime-card.is-low-confidence {
  border-color: rgba(255, 175, 69, 0.18);
}


.catalog-empty {
  padding: 38px 20px;
  color: var(--muted-2);
  text-align: center;
}

.catalog-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.catalog-empty p {
  margin: 0;
  font-size: 9px;
}

.catalog-load-more {
  display: block;
  width: calc(100% - 24px);
  height: 34px;
  margin: 0 12px 12px;
  border: 1px solid #3a323f;
  border-radius: 7px;
  color: #aca1b2;
  background: #1b171f;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.catalog-load-more:hover {
  border-color: #66526b;
  color: #f1e8f4;
}

.anime-pool-heading {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 15px 20px 12px;
  border-top: 1px solid var(--line);
}

.anime-pool-heading > div > span {
  color: #ff8eae;
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.anime-pool-heading h3 {
  margin: 4px 0 0;
  font-size: 14px;
}

.anime-pool-search {
  width: 220px;
}

.anime-pool-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.batch-manage-button {
  height: 37px;
  padding: 0 11px;
  border: 1px solid #3b3441;
  border-radius: 8px;
  color: #b8aebd;
  background: #19161d;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.batch-manage-button:hover,
.batch-manage-button.is-active {
  border-color: rgba(255, 124, 162, 0.42);
  color: #ffbdd0;
  background: rgba(255, 124, 162, 0.06);
}

.batch-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 20px 12px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 124, 162, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 124, 162, 0.07), transparent),
    #17141b;
}

.batch-toolbar strong {
  color: #ffc1d1;
  font-size: 10px;
}

.batch-toolbar > span {
  flex: 1;
  color: #746b7a;
  font-size: 8px;
}

.batch-toolbar > div {
  display: flex;
  gap: 5px;
}

.batch-toolbar button {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #3b3441;
  border-radius: 6px;
  color: #b8afbd;
  background: #211c25;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.batch-toolbar button:hover {
  border-color: #665268;
  color: #f1e8f3;
}

.batch-toolbar .batch-remove-button {
  border-color: rgba(255, 102, 92, 0.38);
  color: #ffafa8;
  background: rgba(255, 102, 92, 0.07);
}

.game-card.is-selected {
  border-color: #ff8eae;
  box-shadow:
    0 0 0 2px rgba(255, 124, 162, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.2);
}

.batch-check {
  position: absolute;
  z-index: 5;
  top: 7px;
  right: 7px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  color: transparent;
  background: rgba(15, 13, 18, 0.72);
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(5px);
}

.game-card.is-selected .batch-check {
  border-color: #ffc0d2;
  color: #24141d;
  background: #ff9dbb;
}

.game-card.batch-mode .card-menu {
  display: none;
}

.anime-pool-grid {
  padding-top: 0;
}

.anime-pool-grid .game-card {
  border-color: #39323e;
  background: #211d27;
}

.anime-pool-grid .game-art-wrap {
  aspect-ratio: 1 / 1.28;
}

.anime-card-source {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: #ffe4ed;
  background: rgba(47, 31, 48, 0.76);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.4px;
  backdrop-filter: blur(5px);
}

.anime-modal-hero {
  height: 230px;
}

.anime-form-label {
  display: block;
  margin: 14px 0 6px;
  color: #cbc2d1;
  font-size: 9px;
  font-weight: 700;
}

.anime-form-input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #100f14;
  font-size: 11px;
}

.anime-form-input:focus {
  border-color: #8c5c70;
}

.anime-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 11px;
}

.anime-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cbc2d1;
  font-size: 9px;
  font-weight: 700;
}

.anime-app .full-button {
  margin-top: 12px;
}

.anime-app .primary-button {
  border-color: #ffb4c8;
  background: linear-gradient(135deg, #ffd5e0, #f39ab3);
}

.anime-app .progress-track span {
  background: linear-gradient(90deg, #ff7ca2, #79dfdc);
}

.anime-app .tier-choice.current {
  outline-color: #fff2f6;
}

.anime-app .game-card:hover {
  border-color: color-mix(in srgb, var(--tier-color, #ff7ca2) 50%, #5b5268);
}

@media (max-width: 760px) {
  .bangumi-login-button {
    height: 34px;
    padding: 0 8px;
    font-size: 8px;
  }

  .bangumi-login-button span {
    display: none;
  }

  .anime-dashboard {
    padding-top: 32px;
  }

  .anime-dashboard-heading {
    gap: 18px;
  }

  .anime-guest-note {
    align-items: flex-start;
  }

  .anime-guest-note button {
    flex: 0 0 auto;
  }

  .anime-year-select {
    order: -1;
  }

  .anime-search-results {
    top: 92px;
    grid-template-columns: 1fr;
  }

  .anime-pool-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .catalog-custom-years {
    flex-wrap: wrap;
  }

  .catalog-custom-years button {
    width: 100%;
    margin-left: 0;
  }

  .anime-pool-search {
    width: 100%;
  }

  .anime-pool-actions {
    width: 100%;
  }

  .batch-toolbar {
    align-items: stretch;
    flex-direction: column;
    margin: 0 13px 10px;
  }

  .batch-toolbar > div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .anime-dashboard-heading h1 {
    font-size: 38px;
  }

  .anime-guest-note {
    flex-wrap: wrap;
  }

  .anime-search-area {
    padding: 0 13px 13px;
  }

  .bangumi-catalog {
    margin: 0 13px 13px;
  }

  .catalog-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .catalog-filters label {
    flex: 1;
  }

  .catalog-filters select {
    width: 100%;
  }

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

  .anime-search-results {
    right: 13px;
    left: 13px;
  }

  .anime-search-result {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .anime-search-result img {
    width: 70px;
    height: 94px;
  }

  .anime-search-result-action {
    display: none;
  }

  .anime-pool-heading {
    padding: 14px 13px 10px;
  }

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