/* -----------------------------------------------------------
   VARIABLES & IMPORTS
----------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Alata&family=DotGothic16&display=swap');

@font-face {
  src: url(/fonts/dingbats.woff2);
  font-family: 'puf';
}

:root {
  --background: #f0f0f0;
  --content-background: #fff;
  --text: #616161;
  --links: #8c8c8c;
  --title: #212121;
  --borders: #e0e0e0;
  --accent: #9fa8da;
  --gradient-1: #7986cb;
  --gradient-2: #e1bee7;
  --icon-background: #f5f6ff;
  --sidebar-link-background: #f5f5f5;
  --statistics-background: #f5f5f5;

  --fave-colour-one: #a1cdf7;
  --fave-colour-two: #f5bad9;
  --fave-colour-three: #abb6ff;
  --fave-colour-four: #ffc9dd;
}

/* -----------------------------------------------------------
  GLOBAL STYLES
----------------------------------------------------------- */

body {
  background-image: url(/media/backgrounds/pinkcheck.png);
  background-size: 40px;
  overflow-x: hidden;
  font-family: 'nunito';
  color: #6d6d6d;
  font-size: 15px;
  padding-top: 40px;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

mark {
  background-color: #feeef6;
  color: #6d6d6d;
  font-weight: bold;
}

body,
a,
button {
  cursor: url(/media/cursor/melody.webp), progress;
}

a:hover,
button:hover,
img:hover {
  cursor: url("/media/cursor/melody.webp"), pointer;
}

.text {
  color: #616161;
  font-size: 18px;
  font-weight: 900;
}

.mobile-only {
  display: none;
}

#context_menu,
#context_menu ul,
#context_menu li {
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
}

#s-m-t-tooltip {
  max-width: 150px;
  background-color: white;
  border: 7px solid;
  border-image: url(/media/borders/pink.png) 5 fill round;
  border-image-outset: 2px;
  outline: 1px dashed #e1b3c7;
  outline-offset: -6px;
  border-radius: 4px;
  font-family: tahoma;
  font-size: 7px;
  letter-spacing: 2px;
  color: #848484;
  position: fixed;
  z-index: 100000 !important;
  pointer-events: none;
  padding: 4px;
  text-align: center;
  margin: 0;
}

/* -----------------------------------------------------------
   SELECTION & SCROLLBARS
----------------------------------------------------------- */

::selection {
  background-color: #feeef6;
  color: #616161;
}

::-moz-selection {
  background-color: #feeef6;
  color: #616161;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
  margin: 5px;
}

::-webkit-scrollbar-thumb {
  background-color: #ffcce6;
  border-radius: 50px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #ffb3d9;
}

/* -----------------------------------------------------------
   LINKS & HOVERS
----------------------------------------------------------- */

a {
  color: #616161;
  text-decoration: none;
  font-weight: 800;
  transition: .1s;
}

a:link,
a:visited,
a:active {
  color: #616161;
  font-weight: 800;
  background-color: transparent;
  text-decoration: none;
}

a:hover {
  color: #ff94bf;
  font-weight: 800;
  background-color: transparent;
  text-decoration: underline;
  font-style: italic;
}

/* -----------------------------------------------------------
   MAIN SIDEBAR & ICON
----------------------------------------------------------- */

#sidebar {
  width: 260px;
  text-align: center;
  height: 100%;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  padding: 30px;
  background-color: white;
  overflow: hidden;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  border: 35px solid;
  border-image: url('/media/borders/renda-bg.png') 18 repeat;
  border-image-outset: 5px;
  border-top: 0px;
  border-bottom: 0px;
  border-left: 0px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#sidebar .icon-wrapper {
  position: relative;
  display: inline-block;
}

#sidebar .icon {
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  padding: 4px;
  border: 6px solid #ffd8e9;
}

#sidebar .icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

#sidebar .icon .status-icon {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid white;
  padding: 3px;
  bottom: 0px;
  right: 8px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
  background-image: url('/media/graphics/heart.png');
  background-size: 85%;
  background-repeat: no-repeat;
  background-position: center;
}

.sidebar-buttons {
  margin-top: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-btn:before {
  content: "";
  width: 20px;
  height: 20px;
  background-image: url(/media/graphics/white-heart.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 3px solid #ffffff;
  outline: 1px solid #c3c3c3;
  font-size: 14px;
  font-weight: 700;
  color: #5c5c5c;
  background: #fff3f9;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.85),
    inset -1px -1px 0 rgba(0, 0, 0, 0.18),
    inset 0 -2px 3px rgba(0, 0, 0, 0.12),
    inset 0 2px 2px rgba(255, 255, 255, 0.4);
  transition: background .15s ease, box-shadow .15s ease;
  text-decoration: none;
}


.sidebar-buttons a.sidebar-btn {
  background-color: #feeef6;
  color: #616161;
}

.sidebar-buttons a.sidebar-btn:hover {
  background-color: #ffe7f3;
}

.sidebar-btn:hover {
  background: #ffe7f3;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.95),
    inset -2px -2px 0 rgba(0, 0, 0, 0.2),
    inset 0 -3px 4px rgba(0, 0, 0, 0.16),
    inset 0 2px 3px rgba(255, 255, 255, 0.45);
  font-style: italic;
}

.sidebar-buttons a {
  text-decoration: none;
}

/* -----------------------------------------------------------
   TOP NAVIGATION HEADER
----------------------------------------------------------- */

#top-header {
  margin-left: 260px;
  padding: 0 40px 20px 40px;
  display: flex;
  justify-content: center;
}

.header-nav {
  background-color: var(--content-background);
  border-radius: 18px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--borders);
}

.header-nav .sep {
  font-size: 16px;
  user-select: none;
}

.header-nav a {
  font-family: 'nunito';
  font-size: 14px;
  font-weight: 700;
  color: #616161;
  text-decoration: none;
  position: relative;
}

.header-nav a:hover {
  font-style: italic;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 4px;
  background-color: var(--fave-colour-two);
  transition: width 0.2s ease;
}

.header-nav a:hover::after {
  width: 100%;
}

/* -----------------------------------------------------------
   PAGE LAYOUT & CONTENT BOX
----------------------------------------------------------- */

#page {
  margin-left: 260px;
  padding: 30px 40px;
  display: flex;
  justify-content: center;
  gap: 0;
  align-items: flex-start;
  transition: gap .35s ease;
  position: relative;
}

.content-box {
  flex: 1;
  max-width: 900px;
  background: #fff;
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  border: 1px solid var(--borders);
  transition: max-width .35s ease;
  position: relative;
  overflow: hidden;
}

#home {
  display: block;
}

/* -------------------- 
   DEFAULT CONTENT TEXT 
   -------------------- */

.default-content {
  width: 100%;
  font-size: 16px;
  transition: opacity .25s ease;
}

.default-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 260px;
}

.top-img {
  width: 380px;
  height: auto;
  align-self: flex-start;
}

.welcome-img {
  width: 250px;
  max-width: 40%;
  height: auto;
  transform: scaleX(-1);
}

.default-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  color: #6f6f6f;
  padding: 20px;
}

.default-text h2 {
  font-size: 20px;
  color: #616161;
  margin-bottom: 10px;
  text-align: left;
}

.default-text p {
  font-size: 15px;
  text-align: left;
}

.default-text span {
  background-color: #feeef6 !important;
  color: #6d6d6d;
  font-size: 15px !important;
}

#anime .animes-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  color: #6f6f6f;
}

#anime .default-inner {
  display: flex !important;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
}

#anime .anime-img {
  width: 230px;
  height: auto;
  margin-left: 20px;
  flex-shrink: 0;
}

#manga .manga-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  color: #6f6f6f;
}

#manga .default-inner {
  display: flex !important;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
}

#manga .manga-img {
  width: 265px;
  height: auto;
  margin-left: 20px;
  flex-shrink: 0;
}

#novel .novel-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  color: #6f6f6f;
}

#novel .novel-img {
  width: 180px;
  height: auto;
  margin-left: 20px;
  flex-shrink: 0;
  margin-right: 10px;
}

#novel .default-inner {
  display: flex !important;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
}

#novel .manga-img {
  width: 250px;
  height: auto;
  margin-left: 20px;
  flex-shrink: 0;
}

#star {
  font-size: 18px;
  font-family: puf;
  margin-bottom: 15px;
  letter-spacing: 0.1em;
}

.review-gallery summary h2::before {
  content: "› ";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.review-gallery[open] summary h2::before {
  content: "» ";
  transform: rotate(90deg);
}

.rotate {
  transform: rotate(90deg);
}

.review-gallery summary h2 {
  display: flex;
  align-items: center;
  cursor: url(/media/cursor/melody.webp), progress;
}

.nav-search {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
}

.menu-search {
  background: #fff;
  border: 1px solid #ffbcd9;
  border-radius: 15px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: inherit;
  color: #666;
  outline: none;
  width: 150px;
  cursor: url(/media/cursor/melody.webp), progress;
}

#anime-search-grid,
#manga-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
}

.dropdown {
  display: inline-block;
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 160px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
  z-index: 999;
  border: 1px solid lightgray;
  border-radius: 12px;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top: 10px solid transparent;
  background-clip: padding-box;
  padding-bottom: 8px;
}

.dropdown-content.active {
  display: flex;
  flex-direction: column;
}

.dropdown-content span {
  font-size: 13px;
  color: #8c8c8c;
  cursor: pointer;
  padding: 6px 15px;
  margin: 4px 10px;
  transition: 0.2s ease;
  text-align: left;
  display: block;
  font-weight: 700;
  border-radius: 20px;
  cursor: url(/media/cursor/melody.webp), progress;
}

.dropdown-content span:hover {
  background-color: #feeef6;
  font-style: italic;
  font-weight: 700;
  cursor: url(/media/cursor/melody.webp), progress;
}

.dropdown:hover .dropdown-content {
  display: flex;
  flex-direction: column;
}

.dropdown.sticky .dropdown-content {
  display: flex;
  flex-direction: column;
}

/* -----------------------------------------------------------
   SECTION LOGIC
----------------------------------------------------------- */

#page:has(.section:target) .default-content {
  display: none;
}

#page:has(.section:target) .default-content {
  opacity: 0;
  pointer-events: none;
}

#page:not(:has(.section:target)) .content-box,
#page:has(#code:target) .content-box {
  max-width: 750px;
}

.section {
  display: none;
}

.section h2 {
  font-size: 20px;
  color: #616161;
  margin-bottom: 12px;
}

.section h2,
.default-text h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.section:target {
  display: block;
}

.section.main-section:has(~ .sub-section:target[data-parent]),
#page:has(.sub-section[data-parent="anime"]:target) #anime,
#page:has(.sub-section[data-parent="manga"]:target) #manga,
#page:has(.sub-section[data-parent="novel"]:target) #novel,
#page:has(.sub-section[data-parent="books"]:target) #books,
#page:has(.sub-section[data-parent="favorites"]:target) #favorites,
#page:has(.sub-section[data-parent="stats"]:target) #stats {
  display: none;
}

.sub-section {
  display: none;
}

/* -----------------------------------------------------------
   SUB-SECTION MENUS & SMOOTH TRANSITION
----------------------------------------------------------- */

.anime-menu,
.section-menu {
  background: var(--content-background);
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  border: 1px solid var(--borders);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  left: 0;
  width: 180px;
  padding: 14px;
  font-size: 12px;
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}

.anime-menu a,
.section-menu a {
  font-size: 13px;
  font-weight: 700;
  color: #7a7a7a;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1.2;
  text-decoration: none;
}

.anime-menu a:hover,
.section-menu a:hover {
  background: #feeef6;
  font-style: italic;
}

#page:has(.section:target) {
  gap: 24px;
}

#page:has(.section:target) .content-box {
  max-width: 660px;
}

#page:has(#anime:target) .anime-menu,
#page:has(.sub-section[data-parent="anime"]:target) .anime-menu,
#page:has(#manga:target) .section-menu[data-section="manga"],
#page:has(.sub-section[data-parent="manga"]:target) .section-menu[data-section="manga"],
#page:has(#novel:target) .section-menu[data-section="novel"],
#page:has(.sub-section[data-parent="novel"]:target) .section-menu[data-section="novel"],
#page:has(#books:target) .section-menu[data-section="books"],
#page:has(.sub-section[data-parent="books"]:target) .section-menu[data-section="books"],
#page:has(#favorites:target) .section-menu[data-section="favorites"],
#page:has(.sub-section[data-parent="favorites"]:target) .section-menu[data-section="favorites"],
#page:has(#stats:target) .section-menu[data-section="stats"],
#page:has(#recommendations:target) .section-menu[data-section="recommendations"],
#page:has(.sub-section[data-parent="recommendations"]:target) .section-menu[data-section="recommendations"],
#page:has(.sub-section[data-parent="stats"]:target) .section-menu[data-section="stats"] {
  position: relative;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.section-menu[data-section="recommendations"] {
  position: absolute;
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
  transition: all .35s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 180px;
  text-align: left;
}

/* -----------------------------------------------------------
   EFFECTS
----------------------------------------------------------- */

.zoom {
  transition: transform .2s;
}

.zoom:hover {
  -ms-transform: scale(1.05);
  -webkit-transform: scale(1.05);
  transform: scale(1.05);
}

/* -----------------------------------------------------------
   GRAPHICS
----------------------------------------------------------- */

.source-link:hover {
  font-style: italic !important;
  text-decoration: none !important;
  color: #ffbcd9 !important;
}

.favorites-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 30px 20px;
  border-radius: 18px;
}

.fav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  gap: 10px;
}

.fav-value {
  font-size: 14px;
  font-weight: 800;
  color: #616161;
}

.bar-column {
  height: 160px;
  display: flex;
  align-items: flex-end;
}

.bar-rect {
  width: 42px;
  height: 0;
  background: #ffbcd9;
  border-radius: 10px 10px 0 0;
  transition: height 1s ease;
}

.fav-label {
  font-size: 13px;
  font-weight: 700;
  color: #949494;
  text-align: center;
}

.fav-label::before {
  content: "♡";
  display: block;
  font-size: 18px;
  opacity: 0.6;
}

.cover-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.cover-card {
  justify-content: center;
  align-items: center;
  width: 120px;
  height: 170px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  display: inline-block;
  transition: 0.5s ease;
  flex: 0 0 120px;
}

#grid-fav-animes,
#grid-fav-mangas,
#grid-fav-novels,
#grid-fav-books,
#grid-fav-characters {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 20px !important;
  row-gap: 30px !important;
  padding: 20px 0;
  width: 100%;
}

.heart-img {
  width: 22px !important;
  height: 22px !important;
  pointer-events: none;
}

.fav-heart-img {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  width: 22px !important;
  height: 22px !important;
  z-index: 100;
  pointer-events: none;
  transform: none !important;
}

.disliked-icon {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  width: 22px !important;
  height: 22px !important;
  z-index: 100;
  pointer-events: none;
  transform: none !important;
}

.low-rating-img {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  width: 22px !important;
  height: 22px !important;
  z-index: 100;
  pointer-events: none;
  transform: none !important;
}

.cover-card img {
  width: 120px;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cover-info {
  position: absolute;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  background-color: rgba(255, 216, 233, 0.8);
  color: #3e3e3e;
  font-size: 12px;
  border-radius: 0 0 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.cover-card:hover .cover-info {
  opacity: 1;
  visibility: visible;
}

.cover-info strong {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
}

[id^="grid-"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
}

#image-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.modal-container {
  background: white;
  padding: 15px;
  border-radius: 5px;
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-container img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 3px;
}

.modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: white;
  color: #333;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  text-align: center;
  line-height: 25px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.modal-caption {
  margin-top: 15px;
  font-size: 13px;
  color: #555;
  text-align: center;
  text-transform: lowercase;
}

.gallery-img {
  filter: blur(4px);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.gallery-img:hover {
  filter: blur(0);
  transform: scale(1.02);
}

#modal-img {
  filter: none !important;
}

#recommendations {
  width: 100%;
}

.message-board-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#recommendation-form,
#form-wrapper,
#thanks-message {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.message-bubble {
  width: 100%;
  max-width: 800px;
  height: 120px;
  background: #ffffff;
  border: 2px solid #ffd8e9;
  border-radius: 25px;
  padding: 15px;
  font-family: inherit;
  font-size: 14px;
  color: #555;
  resize: none;
  outline: none;
  box-sizing: border-box;
  transition: all 0.3s ease;
  font-style: italic;
}

.thanks-bubble {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: #8c8c8c;
  border-style: solid;
  background: #fff5fa;
}

.send-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 3px solid #ffffff;
  outline: 1px solid #ffd8e9;
  font-size: 13px;
  font-weight: 700;
  color: #616161;
  background: #ffe5f0;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.85),
    inset -1px -1px 0 rgba(0, 0, 0, 0.18),
    inset 0 -2px 3px rgba(0, 0, 0, 0.12),
    inset 0 2px 2px rgba(255, 255, 255, 0.4);
  transition: background .15s ease, box-shadow .15s ease;
  text-decoration: none;
  margin-top: 20px;
  font-family: 'nunito';
}

.send-button:hover {
  background-color: #ffd3e6;
}

/* -----------------------------------------------------------
   SMOOTH SECTION TRANSITIONS
----------------------------------------------------------- */

.novel-bar-rect {
  transition: width 1s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

@keyframes cozyBarGrowHorizontal {
  from {
    width: 0%;
  }
}

.novel-bar-initial-load {
  animation: cozyBarGrowHorizontal 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section:target {
  display: block;
  animation: sectionFadeIn 0.4s ease-out forwards;
}

.default-content {
  animation: sectionFadeIn 0.4s ease-out forwards;
}

.anime-menu,
.section-menu {
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-wrapper {
  width: 100%;
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dotted var(--borders);
}

.back-to-top {
  font-size: 12px;
  color: #b0b0b0;
  text-transform: lowercase;
  transition: all 0.3s ease;
}

.back-to-top:hover {
  color: #ff94bf;
  font-style: italic;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
  color: #ffb7c5;
  font-size: 14px;
  text-transform: lowercase;
}

.heart-pulse {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(0.95);
  }
}

#loading-heart {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.gallery-masonry {
  column-count: 5;
  column-gap: 8px;
}

.gallery-masonry img {
  width: 100%;
  display: block;
  margin-bottom: 8px;
  break-inside: avoid;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 1200px) {
  .gallery-masonry {
    column-count: 4;
  }
}

/* -----------------------------------------------------------
    MOBILE & TABLET OPTIMIZATIONS
----------------------------------------------------------- */
@media (max-width: 1024px) {

  html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  body {
    padding-top: 20px;
    background-size: 30px;
  }

  #sidebar {
    display: none !important;
  }

  #top-header {
    margin-left: 0 !important;
    padding: 10px 15px 5px 15px !important;
    display: flex;
    justify-content: center;
  }

  .header-nav {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 16px !important;
    gap: 8px !important;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-nav .sep {
    font-size: 12px !important;
  }

  .header-nav a {
    font-size: 12px !important;
  }

  .header-nav a[href="#recommendations"] {
    display: none !important;
  }

  .header-nav .sep:has(+ a[href="#recommendations"]) {
    display: none !important;
  }

  .header-nav a::after {
    height: 3px !important;
    bottom: -2px !important;
  }

  #page {
    margin-left: 0;
    padding: 10px 15px;
    flex-direction: column;
    align-items: center;
    gap: 15px !important;
  }

  .content-box {
    width: 100%;
    max-width: 100% !important;
    padding: 16px;
    box-sizing: border-box;
    order: 2;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .default-inner,
  #anime .default-inner,
  #manga .default-inner,
  #novel .default-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: auto;
  }

  .default-text,
  #anime .animes-text,
  #manga .manga-text,
  #novel .novel-text {
    padding: 5px 0;
    flex: 1;
  }

  .default-text h2,
  .section h2 {
    font-size: 16px !important;
    text-align: left;
    margin-top: 0;
    margin-bottom: 12px;
  }

  .default-text p,
  .section p {
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: left;
  }

  .default-text span {
    background-color: #feeef6 !important;
    color: #6d6d6d;
    font-size: 11px !important;
    display: inline !important;
    padding: 2px 5px;
    border-radius: 4px;
  }

  .top-img,
  .welcome-img,
  #anime .anime-img,
  #manga .manga-img,
  #novel .novel-img {
    width: 32% !important;
    max-width: 115px;
    height: auto;
    margin: 0 0 0 8px !important;
    align-self: center;
    flex-shrink: 0;
  }

  #page:has(#anime:target) .anime-menu,
  #page:has(.sub-section[data-parent="anime"]:target) .anime-menu,
  #page:has(#manga:target) .section-menu[data-section="manga"],
  #page:has(.sub-section[data-parent="manga"]:target) .section-menu[data-section="manga"],
  #page:has([id^="m-"]:target) .section-menu[data-section="manga"],
  #page:has(#novel:target) .section-menu[data-section="novel"],
  #page:has(.sub-section[data-parent="novel"]:target) .section-menu[data-section="novel"],
  #page:has(#books:target) .section-menu[data-section="books"],
  #page:has(.sub-section[data-parent="books"]:target) .section-menu[data-section="books"],
  #page:has(#favorites:target) .section-menu[data-section="favorites"],
  #page:has(.sub-section[data-parent="favorites"]:target) .section-menu[data-section="favorites"],
  #page:has(#stats:target) .section-menu[data-section="stats"],
  #page:has(.sub-section[data-parent="stats"]:target) .section-menu[data-section="stats"] {
    position: relative;
  }

  [id^="grid-"],
  [class*="grid-"],
  .manga-grid,
  .mangas-grid,
  #anime-search-grid,
  #manga-search-grid,
  #novel-search-grid,
  div:has(> .cover-card),
  .sub-section:target div:has(> .cover-card),
  [id^="m-"]:target div:has(> .cover-card) {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }

  @media (min-width: 769px) {

    [id^="grid-"],
    [class*="grid-"],
    .manga-grid,
    .mangas-grid,
    #anime-search-grid,
    #manga-search-grid,
    #novel-search-grid,
    div:has(> .cover-card),
    .sub-section:target div:has(> .cover-card),
    [id^="m-"]:target div:has(> .cover-card) {
      grid-template-columns: repeat(6, 1fr) !important;
    }
  }

  .cover-card {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 120 / 170 !important;
    flex: none !important;
    margin: 0 !important;
  }

  .cover-card img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
  }

  .heart-img {
    width: 16px !important;
    height: 16px !important;
  }

  .cover-card .fav-heart-img,
  .cover-card .disliked-icon,
  .cover-card .low-rating-img {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    bottom: auto !important;
    width: 16px !important;
    height: 16px !important;
    z-index: 100 !important;
    transform: none !important;
  }

  .favorites-chart {
    flex-wrap: wrap;
    gap: 15px;
  }

  /* -----------------------------------------------------------
      ANIME & SECTION MENUS 
  ----------------------------------------------------------- */
  .anime-menu,
  .section-menu {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 5px;
    order: 1;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .section-menu[data-section="recommendations"] {
    display: none !important;
  }

  .anime-menu .nav-search,
  .section-menu .nav-search {
    grid-column: span 3;
    width: 100%;
    margin-bottom: 4px;
  }

  .anime-menu .menu-search,
  .section-menu .menu-search {
    width: 100% !important;
    box-sizing: border-box;
  }

  .anime-menu a,
  .section-menu a {
    text-align: left;
    padding: 8px 10px;
    box-sizing: border-box;
    display: block;
  }
}

.section,
.sub-section,
.gallery-masonry {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

details summary {
  will-change: transform;
}