@font-face{
  font-family:SegoeUI;
  src:url("assets/Segoe UI.ttf")
}

@font-face{
  font-family:SegoeUI;
  src:url("assets/Segoe UI Bold.ttf");
  font-weight:700
}

:root{
  --bg:#080c14;
  --block:#121a2b;
  --border:#202c41;
  --blue:#2563eb;
  --blue2:#4d82ff;
  --red:#ff4b4b;
  --muted:#91a2bd;
  --muted2:#66738a;
  --card:#172237;
  --white:#fff;
  --orange:#ffad1f;
  --green:#45d46b
}

*{
  box-sizing:border-box
}

html,
body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:#fff;
  font-family:SegoeUI,Arial,sans-serif
}

body{
  background:
    radial-gradient(
      circle at 50% -15%,
      #1b2946 0,
      transparent 44%
    ),
    var(--bg)
}

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

button{
  cursor:pointer
}


/* =========================
   SPLASH SCREEN
   ========================= */

.splash{
  position:fixed;
  inset:0;
  z-index:9999;
  background:#000;
  display:grid;
  place-items:center;
  overflow:hidden;
  transition:
    opacity .45s ease,
    visibility .45s ease
}

.splash.hide{
  opacity:0;
  visibility:hidden
}

.splash-logo{
  width:min(330px,65vw);
  filter:drop-shadow(
    0 0 30px rgba(255,255,255,.2)
  );
  animation:
    splashLogo .8s cubic-bezier(.2,.8,.2,1) both
}

.splash-glow{
  position:absolute;
  width:300px;
  height:300px;
  border-radius:50%;
  background:rgba(37,99,235,.16);
  filter:blur(70px);
  animation:splashGlow .8s ease both
}

@keyframes splashLogo{
  0%{
    opacity:0;
    transform:scale(.72) translateY(18px);
    filter:blur(8px)
  }

  55%{
    opacity:1;
    transform:scale(1.05)
  }

  100%{
    opacity:1;
    transform:scale(1)
  }
}

@keyframes splashGlow{
  0%{
    opacity:0;
    transform:scale(.5)
  }

  100%{
    opacity:1;
    transform:scale(1.3)
  }
}


/* =========================
   TOPBAR
   ========================= */

.topbar{
  height:76px;
  border-bottom:1px solid var(--border);
  background:rgba(8,12,20,.9);
  backdrop-filter:blur(16px);
  display:flex;
  align-items:center;
  padding:0 30px;
  gap:20px;
  position:sticky;
  top:0;
  z-index:20
}

.brand{
  border:0;
  background:none;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0
}

.brand-logo{
  width:130px;
  height:52px;
  object-fit:contain;
  display:block
}

.topbar nav{
  display:flex;
  gap:4px;
  align-items:center;
  flex:1;
  overflow:auto
}

.topbar nav button{
  border:0;
  background:transparent;
  color:var(--muted);
  padding:10px 13px;
  border-radius:10px;
  white-space:nowrap;
  transition:.2s
}

.topbar nav button:hover,
.topbar nav button.active{
  background:#182542;
  color:#fff
}

#account{
  display:flex;
  gap:8px;
  align-items:center
}


/* =========================
   CONTAINER
   ========================= */

.container{
  max-width:1180px;
  margin:0 auto;
  padding:32px 22px 80px
}

.page-enter{
  animation:
    pageEnter .55s cubic-bezier(.2,.8,.2,1)
}

@keyframes pageEnter{
  0%{
    opacity:0;
    transform:translateY(10px) scale(.99);
    filter:blur(4px)
  }

  100%{
    opacity:1;
    transform:none;
    filter:none
  }
}


/* =========================
   HERO
   ========================= */

.hero{
  padding:24px 0 28px
}

.eyebrow{
  color:#4f86ff;
  font-weight:700;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em
}

.hero h1{
  font-size:42px;
  line-height:1.05;
  margin:8px 0 12px;
  max-width:800px
}

.hero p{
  color:var(--muted);
  max-width:760px;
  line-height:1.7
}


/* =========================
   BLOCK
   ========================= */

.block{
  background:
    linear-gradient(
      180deg,
      #141d31,
      #11192a
    );
  border:1px solid var(--border);
  border-radius:17px;
  padding:20px;
  box-shadow:0 20px 50px rgba(0,0,0,.15)
}


/* =========================
   INPUTS
   ========================= */

.search-row{
  display:flex;
  gap:10px
}

.input,
.select,
.textarea{
  width:100%;
  background:#172236;
  color:#fff;
  border:1px solid #243149;
  border-radius:10px;
  padding:12px 13px;
  outline:none;
  transition:.2s
}

.input:focus,
.select:focus,
.textarea:focus{
  border-color:var(--blue2);
  box-shadow:
    0 0 0 3px rgba(37,99,235,.12)
}


/* =========================
   BUTTONS
   ========================= */

.btn{
  border:1px solid var(--border);
  background:#18243a;
  color:#fff;
  border-radius:10px;
  padding:11px 15px;
  transition:.2s
}

.btn:hover{
  transform:translateY(-2px);
  border-color:#385277
}

.btn.primary{
  background:var(--blue);
  border-color:var(--blue)
}

.btn.danger{
  color:var(--red);
  border-color:rgba(255,75,75,.4);
  background:#211a26
}

.btn.ghost{
  background:transparent
}

.btn.small{
  padding:7px 10px;
  font-size:13px
}

.link-btn{
  border:0;
  background:none;
  color:#6f9cff;
  padding:0;
  margin-top:8px;
  cursor:pointer
}


/* =========================
   GRIDS
   ========================= */

.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px
}

.anime-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px
}


/* =========================
   CARDS
   ========================= */

.card{
  background:var(--card);
  border:1px solid #223149;
  border-radius:14px;
  overflow:hidden;
  transition:.25s;
  cursor:pointer
}

.card:hover{
  transform:translateY(-5px);
  border-color:#385277;
  box-shadow:
    0 18px 38px rgba(0,0,0,.28)
}

.cover{
  height:250px;
  background:
    linear-gradient(
      145deg,
      #263b64,
      #101827
    );
  display:grid;
  place-items:center;
  overflow:hidden
}

.cover img,
.admin-thumb img,
.top-thumb img,
.character-photo img,
.ce-preview img{
  width:100%;
  height:100%;
  object-fit:cover
}

.cover-placeholder{
  font-size:58px;
  font-weight:700;
  color:#52698f
}

.card-body{
  padding:14px
}

.card-title{
  font-weight:700;
  line-height:1.3
}

.meta{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
  line-height:1.5
}

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

.score{
  font-weight:700;
  font-size:19px
}

.score.red{
  color:var(--red)
}

.score.gray{
  color:var(--muted2)
}

.score.blue{
  color:#4e83ff
}

.score.orange{
  color:var(--orange)
}

.score.green{
  color:var(--green)
}


/* =========================
   SECTIONS
   ========================= */

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:12px;
  margin:26px 0 14px
}

.section-head h2,
.section-head h3{
  margin:0
}


/* =========================
   FILTERS
   ========================= */

.filters{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px
}


/* =========================
   DETAIL
   ========================= */

.detail{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:24px
}

.detail-cover{
  height:370px
}

.detail h1{
  font-size:34px;
  margin:0 0 8px
}

.facts{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:14px 0
}

.fact{
  background:#172236;
  border:1px solid #243149;
  border-radius:9px;
  padding:9px 11px
}

.fact b{
  display:block;
  font-size:11px;
  color:var(--muted2);
  text-transform:uppercase;
  margin-bottom:3px
}

.description{
  color:var(--muted);
  line-height:1.7
}


/* =========================
   CHARACTERS
   ========================= */

.characters{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px
}

.character{
  background:#172237;
  border:1px solid #223149;
  border-radius:12px;
  padding:13px;
  position:relative
}

.character-photo{
  width:100%;
  aspect-ratio:1;
  border-radius:10px;
  background:
    linear-gradient(
      145deg,
      #2a416b,
      #111927
    );
  display:grid;
  place-items:center;
  overflow:hidden;
  font-size:32px;
  font-weight:700;
  color:#7890ba;
  margin-bottom:10px
}


/* =========================
   RATING
   ========================= */

.rating{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px
}

.rating-row{
  background:#172237;
  border:1px solid #26334b;
  border-radius:12px;
  padding:13px
}

.rating-top{
  display:flex;
  justify-content:space-between;
  gap:10px
}


/* =========================
   ПОЛЗУНКИ ANI RANK
   ========================= */

.range {
  width: 100%;
  height: 6px;

  margin-top: 12px;

  appearance: none;
  -webkit-appearance: none;

  border: 0;
  outline: none;

  border-radius: 999px;

  background: #2563eb;

  cursor: pointer;
}

/* Chrome / Edge / Opera */

.range::-webkit-slider-runnable-track {
  height: 6px;
  background: #2563eb;
  border-radius: 999px;
}

.range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;

  width: 12px;
  height: 12px;

  margin-top: -3px;

  border: 0;
  border-radius: 50%;

  background: #2563eb;

  box-shadow: none;

  cursor: pointer;
}

/* Firefox */

.range::-moz-range-track {
  height: 6px;
  background: #2563eb;
  border-radius: 999px;
}

.range::-moz-range-progress {
  height: 6px;
  background: #2563eb;
  border-radius: 999px;
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;

  border: 0;
  border-radius: 50%;

  background: #2563eb;

  box-shadow: none;

  cursor: pointer;
}

.range:focus {
  outline: none;
}

.range:active::-webkit-slider-thumb {
  transform: scale(1.05);
}

.range:active::-moz-range-thumb {
  transform: scale(1.05);
}


/* Подписи 0 / 10 / 5 */

.range-scale {
  display: flex;
  justify-content: space-between;

  margin-top: 6px;

  color: var(--muted2);
  font-size: 11px;
}


/* =========================
   TOTAL
   ========================= */

.total-box{
  grid-column:1/-1;
  padding:16px;
  border:1px solid #2b3b59;
  background:#10192a;
  border-radius:12px;
  display:flex;
  justify-content:space-between;
  align-items:center
}

.total{
  font-size:30px;
  font-weight:700
}


/* =========================
   PROFILE
   ========================= */

.profile{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:18px
}

.profile-side{
  text-align:center
}

.avatar-lg{
  width:130px;
  height:130px;
  margin:5px auto 15px;
  border-radius:50%;
  background:
    linear-gradient(
      145deg,
      #294571,
      #101827
    );
  display:grid;
  place-items:center;
  font-size:46px;
  font-weight:700
}

.verified{
  color:var(--green)
}

.stat-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px
}

.stat{
  background:#172237;
  border:1px solid #26334b;
  border-radius:11px;
  padding:14px
}

.stat b{
  font-size:22px
}

.stat span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px
}


/* =========================
   FORMS
   ========================= */

.form{
  max-width:560px;
  margin:25px auto
}

.form h1{
  text-align:center
}

.field{
  margin:12px 0
}

.field label{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin-bottom:6px
}

.form-actions{
  display:flex;
  gap:9px;
  margin-top:16px
}

.sep{
  border:0;
  border-top:1px solid var(--border);
  margin:24px 0
}


/* =========================
   TOP LIST
   ========================= */

.top-list{
  display:flex;
  flex-direction:column
}

.top-row{
  display:grid;
  grid-template-columns:42px 66px 1fr auto 30px;
  align-items:center;
  gap:12px;
  padding:9px;
  border-bottom:1px solid #223149;
  min-height:82px
}

.top-row:last-child{
  border-bottom:0
}

.rank{
  font-weight:700;
  color:var(--muted);
  width:42px
}

.top-thumb{
  width:58px;
  height:64px;
  border-radius:8px;
  overflow:hidden;
  background:#1a2941
}

.top-title{
  border:0;
  background:none;
  color:#fff;
  font-weight:700;
  padding:0;
  text-align:left;
  cursor:pointer
}

.top-title:hover{
  text-decoration:underline
}

.remove-top{
  border:0;
  background:transparent;
  color:#6c7480;
  font-size:23px;
  line-height:1;
  width:26px;
  height:26px;
  border-radius:50%;
  cursor:pointer
}

.remove-top:hover{
  background:#252a32;
  color:#aab0b8
}

.top-character .remove-top{
  position:absolute;
  top:8px;
  right:8px
}

.top-character{
  padding-top:18px
}


/* =========================
   ADMIN
   ========================= */

.admin-list{
  display:flex;
  flex-direction:column;
  gap:8px
}

.admin-row{
  display:grid;
  grid-template-columns:64px 1fr auto;
  align-items:center;
  gap:14px;
  background:#172237;
  border:1px solid #223149;
  border-radius:12px;
  padding:9px
}

.admin-thumb{
  width:56px;
  height:68px;
  border-radius:8px;
  overflow:hidden;
  background:#101827
}

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

.admin-form{
  max-width:950px
}

.character-editor-row{
  display:grid;
  grid-template-columns:70px 1fr 1fr 120px 1.4fr auto;
  align-items:center;
  gap:8px;
  background:#172237;
  border:1px solid #26334b;
  border-radius:12px;
  padding:8px;
  margin:8px 0
}

.ce-preview{
  width:58px;
  height:64px;
  border-radius:8px;
  overflow:hidden;
  background:#101827;
  display:grid;
  place-items:center;
  color:#7086a8;
  font-size:24px
}

.ce-actions{
  display:flex;
  gap:5px
}


/* =========================
   MODAL
   ========================= */

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.72);
  display:grid;
  place-items:center;
  padding:20px;
  z-index:50
}

.modal-card{
  width:min(720px,100%);
  max-height:90vh;
  overflow:auto;
  background:var(--block);
  border:1px solid var(--border);
  border-radius:16px;
  padding:20px
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center
}

.close{
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:28px
}


/* =========================
   TOAST
   ========================= */

.toast{
  position:fixed;
  right:20px;
  bottom:20px;
  background:#1a263a;
  border:1px solid #334563;
  color:#fff;
  padding:12px 15px;
  border-radius:10px;
  opacity:0;
  transform:translateY(10px);
  transition:.25s;
  z-index:80
}

.toast.show{
  opacity:1;
  transform:none
}

.admin-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:17px;
  height:17px;
  border-radius:50%;
  background:var(--green);
  color:#07110a;
  font-size:11px;
  margin-left:5px
}

.empty{
  text-align:center;
  color:var(--muted);
  padding:36px
}


/* =========================
   TABLET
   ========================= */

@media(max-width:980px){

  .anime-grid{
    grid-template-columns:repeat(3,1fr)
  }

  .characters{
    grid-template-columns:repeat(3,1fr)
  }

  .filters{
    grid-template-columns:repeat(3,1fr)
  }

  .character-editor-row{
    grid-template-columns:60px 1fr 1fr 100px
  }

  .ce-url{
    grid-column:2/5
  }

  .ce-actions{
    grid-column:5
  }

  .detail,
  .profile{
    grid-template-columns:1fr
  }
}


/* =========================
   MOBILE
   ========================= */

@media(max-width:720px){

  .topbar{
    padding:0 12px;
    gap:8px
  }

  .brand-wordmark{
    display:none
  }

  .topbar nav{
    overflow:auto
  }

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

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

  .rating{
    grid-template-columns:1fr
  }

  .filters{
    grid-template-columns:1fr 1fr
  }

  .top-row{
    grid-template-columns:32px 50px 1fr auto 28px
  }

  .top-thumb{
    width:48px;
    height:58px
  }

  .hero h1{
    font-size:32px
  }

  .search-row{
    flex-direction:column
  }

  .character-editor-row{
    grid-template-columns:55px 1fr
  }

  .ce-last,
  .ce-first,
  .ce-age,
  .ce-url,
  .ce-actions{
    grid-column:auto
  }

  .ce-url{
    grid-column:2
  }

  .ce-actions{
    grid-column:2
  }

  .admin-row{
    grid-template-columns:52px 1fr
  }

  .admin-row-actions{
    grid-column:2
  }
}


/* =========================
   SMALL MOBILE
   ========================= */

@media(max-width:480px){

  .anime-grid,
  .characters,
  .grid{
    grid-template-columns:1fr
  }

  .filters{
    grid-template-columns:1fr
  }

  .detail-cover{
    height:320px
  }

  .hero h1{
    font-size:29px
  }

  .top-row{
    grid-template-columns:28px 46px 1fr 28px
  }

  .top-row .score{
    display:none
  }

  .top-row .meta{
    font-size:11px
  }
}
.range {
  -webkit-appearance: none !important;
  appearance: none !important;

  display: block !important;

  width: 100% !important;
  height: 7px !important;

  margin: 14px 0 0 !important;
  padding: 0 !important;

  border: 0 !important;
  outline: none !important;

  border-radius: 999px !important;

  background: linear-gradient(
    to right,
    #2563eb 0%,
    #2563eb var(--range-progress, 100%),
    #293750 var(--range-progress, 100%),
    #293750 100%
  ) !important;

  cursor: pointer !important;
}


/* Chrome / Edge */

.range::-webkit-slider-runnable-track {
  height: 7px !important;

  border: 0 !important;
  border-radius: 999px !important;

  background: transparent !important;
}


.range::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;

  width: 12px !important;
  height: 12px !important;

  margin-top: -2.5px !important;

  border: 0 !important;
  border-radius: 50% !important;

  background: #2563eb !important;

  box-shadow: none !important;

  cursor: pointer !important;
}


/* Firefox */

.range::-moz-range-track {
  height: 7px !important;

  border: 0 !important;
  border-radius: 999px !important;

  background: #293750 !important;
}


.range::-moz-range-progress {
  height: 7px !important;

  border: 0 !important;
  border-radius: 999px !important;

  background: #2563eb !important;
}


.range::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;

  border: 0 !important;
  border-radius: 50% !important;

  background: #2563eb !important;

  box-shadow: none !important;

  cursor: pointer !important;
}


/* Подписи */

.range-scale {
  display: flex !important;
  justify-content: space-between !important;

  margin-top: 6px !important;

  color: #667085 !important;

  font-size: 10px !important;
}