/*------ Основные переменные ------*/
:root {
  --clr-ink: #e5edf7;
  --clr-ink-dim: #c9d3e3;
  --clr-accent: #377ef0;
  --clr-accenthov: #2a67d5;
  --clr-bg: #0b0f16;
  --card: rgb(192 215 215 / 10%);
  --radius: 20px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a {text-decoration: none;}
li{display: none;}
html {height: 100%; overflow-x: hidden;}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--clr-bg);
  color: var(--clr-ink);
  font-family: Montserrat, sans-serif;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

.bg img{
  position:fixed; inset:0; z-index:-2;
  width:100%; height:100%; object-fit:cover;
  filter:blur(14px) brightness(0.5);
}

/*------ Универсальный контейнер ------*/
.container {
  flex: 1;
  width: 100%;
  display: flex;
  max-width: 800px;
  margin-inline: auto;
  flex-direction: column;
  padding-inline: 15px;
}

/*------ Шапка ------*/
div.topbar {
  position: fixed;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 60px;
  display: flex;
  max-width: 800px;
  align-items: center;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  justify-content: space-between;
  padding-inline: clamp(12px, 3vw, 20px);
  z-index: 10;
}

.search-toggle {
  background: var(--clr-accent);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 10px;
}

.topbar-buttons {
    display: flex;
    gap: 10px; 
}
.filter-toggle {
    display: none;
}

.search-toggle:hover {
  background: var(--clr-accenthov);
}

.search-full {
  display: none;
  flex: 1;
}

.search-full input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  margin-left: 10px;
}

.topbar.active .logo-text,
.topbar.active .search-toggle {
  display: none;
}

.topbar.active .search-full {
  display: block;
}
.search-full {
  display: none;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.search-full input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--clr-ink);
  font-size: 16px;
}

.search-full .send-btn {
  background: var(--clr-accent);
  color: var(--clr-ink);
  border: none;
  border-radius: 10px;
  width: 60px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-full .send-btn:hover {
  background: var(--clr-accenthov);
}

.topbar.active .logo-text,
.topbar.active .search-toggle {
  display: none;
}

.topbar.active .search-full {
  display: flex;
}

#fullsearch{
	grid-column: 1 / -1;
}

.logo-text {
  color: #fff;
  font-family: "Russo One";
  font-size: 22px;
  padding-left: 5px;
  letter-spacing: 1px;
}

nav a {
  display: inline-flex;
  align-items: center;
  gap: 0px;
  padding: 0px 17px 0px 5px;
  border-radius: 15px;
  background: var(--clr-accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  margin-top: 6px;
  transition: background 0.2s ease;
}

nav a:hover {
  background: #058bcb;
}

nav a svg {
  display: block;
  margin-bottom: 2px;
}

/*------ Контент ------*/
.wrapper {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  /*display: grid;*/
  padding-top: 90px;
  /*gap: clamp(10px, 3vw, 32px);*/
}

.content {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 20px;
  width: 100%;
}

/*------ Метки, рейтинг ------*/
.meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.pill {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  color: var(--clr-ink-dim);
}

.rating {
  font-size: 16px;
  font-weight: 600;
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/*------ Видео ------*/
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/*------ Доп. информация ------*/
.extra-info {
  background: rgb(0 0 0 / 30%);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 5px;
  font-size: 14px;
  color: var(--clr-ink-dim);
  box-shadow: var(--shadow);
  margin-bottom: 25px;
}

.extra-info .fact {
  color: var(--clr-ink);
  font-weight: 600;
}

/*------ Заголовок + рейтинг ------*/
.title-rating {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.title-rating .title {
  font-family: "Russo One";
  font-size: clamp(26px, 2.8vw, 35px);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-rating .rating {
  font-size: 16px;
  font-weight: 600;
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.title-rating .rating.alternative {
  position: relative;
}

.title-rating .rating.alternative::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: -1;
}

.title-rating.grid-version {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.title-rating.grid-version .title {
  overflow: hidden; 
}

.title-rating.grid-version .rating {
  position: relative;
  z-index: 1;
}

.background {display: none;}

.bg-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -2; 
  filter: blur(14px) brightness(0.5);
  overflow: hidden;
}

.bg-background .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.bg-background .layer.active {
  opacity: 1;
}

/*------ Сетка карточек ------*/
.grid-cards #dle-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(0.8rem, 2vw, 1.5rem);
  width: 100%;
}

.grid-cards {margin: 10px 0;}

.card-item {
  perspective: 1000px;
  width: 100%;
}

.card {
  width: 100%;
  aspect-ratio: 210 / 332;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  cursor: pointer;
}

.card.flipped {
  transform: rotateY(180deg);
}

.front,
.back {
  position: absolute;
  inset: 0;
  border-radius: 1em;
  overflow: hidden;
  backface-visibility: hidden;
}

.front {
  transform: rotateY(0deg);
  z-index: 2;
}

.back {
  background: #191f1f;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  transform: rotateY(180deg);
  z-index: 1;
}

/* Лицевая часть карточки */
.front-border {
  position: absolute;
  inset: 0;
  border: 2px solid #fffffd;
  border-radius: 1em;
  z-index: 2;
}

.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1em;
}

.rating-card {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.3em 0.6em;
  border-radius: 0.5em;
  font-weight: bold;
  z-index: 3;
}

.back-red {
  position: absolute;
  inset: 0;
  border: 4px solid #fffffd;
  background: rgba(203, 3, 35, 0.85);
  border-radius: 1em;
  z-index: 1;
}

.back-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1em;
}

.back-content .title {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 0.3em;
}

.back-content .info {
  font-size: 0.9em;
  margin-bottom: 1em;
}

.back-content .watch-btn {
  background-color: #eacc08;
  border: none;
  padding: 0.5em 1em;
  font-weight: bold;
  border-radius: 0.5em;
  cursor: pointer;
  transition: 0.3s;
}

.back-content .watch-btn:hover {
  background-color: #ffd700;
}

/*------ Статические страницы ------*/
.static {
	padding: 90px 20px;
}

.static h1 {
  font-size: clamp(20px, 2.5vw, 28px);
}

/*------ Адаптив ------*/
@media (max-width: 992px) {
  .wrapper {
    padding-top: 85px;
  }

  .title-rating {
    gap: 10px;
  }
}

@media (max-width: 820px) {
  .topbar {
    left: 15px !important;       
    right: 15px !important;      
    width: auto !important;     
    transform: none !important; 
  }
}

@media (max-width: 600px) {
  .title-rating .title {
    font-size: 20px;
  }

  .title-rating .rating {
    font-size: 14px;
    padding: 8px 12px;
  }
}
@media (max-width: 768px) {
  .title-rating {
    flex-direction: column;
    margin-top: 15px;
    gap: 10px;
  }
  
  .title-rating .title {
    max-width: 100%;
    font-size: 24px;
  }
  
  .title-rating .rating {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .title-rating .title {
    font-size: 20px;
    max-width: 100%;
  }
  
  .title-rating .rating {
    font-size: 14px;
    padding: 8px 12px;
  }
}

@media (max-width: 768px) {
  footer {
    max-width: 100%;    
    padding: 15px;
  }
  footer .links {
    gap: 10px;
  }
}
@media (max-width: 600px) {
    .filter-toggle {
        background: var(--clr-accent);
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 10px;
    }
    .dle-filter {
        display: none; 
    }
}
@media (min-width: 600px) {
	.dle-filter {
        padding: 20px;
        margin: 15px 0 20px;
    }
}
@media (max-width: 600px) {
    .dle-filter {
      display: grid;
      overflow: hidden;
      transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease;
      max-height: 0;      
      opacity: 0;        
      margin: 0;          
      padding: 0;       
    }

    .dle-filter.open {
      max-height: 1000px;  
      opacity: 1;
      margin: 10px 0 15px;
      padding: 20px;
    }
}


/*------FILTER------*/
.dle-filter {
    display: grid;
    grid-template-rows: auto auto; 
    gap: 16px;
    width: 100%;
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: top;
}

.dle-filter select,
.dle-filter input[type="text"],
.dle-filter input[type="button"] {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--clr-ink);
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.dle-filter select {
    appearance: none;
    -webkit-appearance: none;
    background-position: right 16px center;
    padding-right: 40px;
    background: rgb(52 57 62);
    color: #fff;
}
.dle-filter select:focus,
.dle-filter input[type="text"]:focus {
    box-shadow: 0 0 0 2px var(--clr-accent);
}

.dle-filter input[type="button"] {
    background: var(--clr-accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dle-filter input[type="button"]:hover {
    background: #2a67d5;
}

.dle-filter input[data-dlefilter="reset"] {
    background: rgba(255, 255, 255, 0.1);
    color: var(--clr-ink);
}

.dle-filter input[data-dlefilter="reset"]:hover {
    background: rgba(255, 255, 255, 0.2);
}
.dle-filter input[name="r.ani_year"] {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    position: absolute;
    pointer-events: none;
}
.dle-filter select[name="o.cat"] {
    grid-column: 1 / 2;
    grid-row: 1;
}
.dle-filter input[data-dlefilter="submit"],
.dle-filter input[data-dlefilter="reset"] {
    grid-column: 2 / 3;
    grid-row: 2;
    display: inline-block;
    width: auto;
    margin-right: 10px;
    text-shadow: 0 0 2px #000000;
}
.irs--flat .irs-line {
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
}
.irs--flat .irs-bar {
    background: var(--clr-accent);
    height: 4px;
}
.irs--flat .irs-handle {
    top: 20px;
    width: 18px;
    height: 18px;
    background: var(--clr-accent);
    border-radius: 50%;
}
.irs--flat .irs-handle>i:first-child {
    display: none;
}
.irs--flat .irs-from, 
.irs--flat .irs-to, 
.irs--flat .irs-single {
    background: var(--clr-accent);
}
.irs--flat .irs-from:before, 
.irs--flat .irs-to:before, 
.irs--flat .irs-single:before {
    border-top-color: var(--clr-accent);
}
@media (max-width: 768px) {
    .dle-filter select,
    .slider-container {
        width: 100%;
        grid-column: auto !important;
        grid-row: auto !important;
    }
    .buttons-wrapper {
        display: flex;
        gap: 10px;
        width: 100%;
        grid-column: auto !important;
        grid-row: auto !important;
    }
    .buttons-wrapper input {
        flex: 1;
        width: auto;
    }
}
.buttons-wrapper {
    grid-column: 2 / 3;
    grid-row: 2;
    display: flex;
    gap: 10px;
}
.buttons-wrapper input {
    flex: 1;
    width: auto;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}




/*------ footer ------*/
footer {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 15px;
  text-align: center;
  font-size: 14px;
  color: var(--clr-ink-dim);
  width: 100%;
}

footer .footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
footer .links span {
  color: var(--clr-ink-dim);
  font-weight: 500;
}

footer a {
  color: var(--clr-accent);
  font-weight: 600;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--clr-accenthov);
}

footer .copyright {
  font-size: 12px;
  color: var(--clr-ink-dim);
}


/*------ info ------*/
.message-info {
    grid-column: 1 / -1;
    background-color: #fff;
    color: #000;
    padding: 10px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1;
    font-size: 12px;
    border-left: 5px solid #f34949;
}