/* 0. CSS Reset / Normalize */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #343a40;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* 1. Общие переменные и анимации */
:root {
    --clr-primary: #007bff;
    --clr-primary-light: #00b4ff;
    --clr-secondary: #28a745;
    --clr-bg-dark: #0f172a;
    --clr-bg-light: #e2e8f0;
    --radius: 10px;
    --shadow: 0 3px 10px rgba(0,0,0,.1);
    --shadow-hover: 0 10px 20px rgba(0,0,0,.15);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 2. Шапка и навигация */
header {
    background: #343a40;
    color: #fff;
    padding: .5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 1rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: .9rem;
    padding: .5rem 0;
    position: relative;
    transition: color .3s;
}

nav a::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: linear-gradient(to right, var(--clr-primary), var(--clr-primary-light));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s;
}

nav a:hover::after,
nav a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.menu-toggle {
    display: none;
}

/* 3. Основная раскладка страницы игр */
.hobby-detail {
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hobby-info {
    display: grid;
    grid-template-areas:
        "main sidebar"
        "steam sidebar";
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}
.hobby-main  { grid-area: main; }
.steam-games { grid-area: steam; }
.hobby-sidebar { grid-area: sidebar; }

@media (max-width: 768px) {
    .hobby-info {
        grid-template-columns: 1fr;
    }
}

/* 4. Баннер */
.banner-container {
    position: relative;
}

.game-banner {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
}

.banner-overlay {
    position: absolute;
    inset: auto 0 0;
    padding: 2rem;
      background: linear-gradient(
    180deg,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,.7) 75%,
    rgba(0,0,0,.85) 100%
  );
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
}
.banner-overlay {
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,.7) 75%,
    rgba(0,0,0,.85) 100%
  );
}

.banner-overlay h1 {
    font-weight: 800;
    font-size: 3rem;
    letter-spacing: .5px;
    color: #fff;
    position: relative;
    z-index: 1;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    text-shadow:
        -2px -2px 0 #000,
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000;
}

.banner-overlay h1::before {
    content: '';
    position: absolute;
    inset: -8px -12px;
    background: rgba(0,0,0,.35);
    filter: blur(6px);
    z-index: -1;
    border-radius: 6px;
}

.subtitle {
    font-size: 1.2rem;
    color: #ddd;
    margin: 0;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    text-shadow:
        -2px -2px 0 #000,
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000;
}

/* 5. Сетка статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    color: #fff;
    transition: transform .3s;
    font-size: 1.1rem;
    font-weight: 600;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card h3 { font-size: 2.25rem; margin: .5rem 0 0; }
.stat-card p  { font-size: 1rem; margin: .25rem 0 0; opacity: .9; }
.accent-blue   { background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light)); }
.accent-green  { background: linear-gradient(135deg, var(--clr-secondary), #00d084); }
.accent-purple { background: linear-gradient(135deg, #6f42c1, #a370f7); }

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* 6. Карточки игр */
.game-cards {
    display: grid;
    gap: 1.5rem;
}

.game-card {
    display: flex;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .3s, box-shadow .3s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.game-card img {
    width: 150px;
    height: 200px;
    object-fit: cover;
    transition: transform .5s;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: .9rem;
}

.platform-tag {
    padding: .3rem .8rem;
    border-radius: 20px;
    font-size: .8rem;
    background: #343a40;
    color: #fff;
}

.hours {
    color: #6c757d;
}

.game-rating {
    color: #ffc107;
    font-size: 1.1rem;
}

/* 7. Сейчас играю */
.currently-playing {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.current-game {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.current-game img {
    width: 100px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
}

.progress-bar {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin-top: .5rem;
  width: 100%;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  border-radius: 3px;
  transition: width .6s ease;
}

.genre-list,
.achievements-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.genre-list li,
.achievements-list li {
    padding: .7rem 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.genre-list li::before {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  z-index: 1;
}

.genre-list li::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: .5rem .75rem;
  background: #111827;
  color: #fff;
  font-size: .75rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 10;
}
.genre-list li:hover::after {
  opacity: 1;
}
.genre-list li[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  padding: .5rem .75rem;
  background: #111827;
  color: #fff;
  font-size: .75rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 10;
  white-space: normal;
  bottom: 100%;
  transform: translateX(-50%) translateY(-8px);
  width: 350px;
  max-width: 90vw;  
  z-index: 1999; 

}

.genre-list li[data-tooltip]::before {
  /* стрелка */
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  transition: opacity .25s;
  z-index: 8;
}

.genre-list li:hover::after,
.genre-list li:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px); /* лёгкий «выезд» */
}


.achievements-list li:before {
    content: "🏆";
    color: #ffc107;
    margin-right: .5rem;
}

.platforms {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1rem;
}

/* ======  ОСНОВНОЙ КОНТЕЙНЕР STEAM гамес ====== */
.steam-games {
  margin-top: 3rem;
}

.steam-games h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.mini-toggle {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform .2s;
}

.mini-toggle:hover {
    transform: scale(1.1);
}

.steam-list.hidden {
    display: none;
}

/* ======  СЕТКА  ====== */
.steam-list ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}
/* ======  КАРТОЧКА  ====== */
.steam-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform .35s ease, box-shadow .35s ease;
}

.steam-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #007bff, #00b4ff);
  opacity: 0;
  transition: opacity .35s ease;
  z-index: 1;
  mix-blend-mode: multiply;
}

.steam-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,123,255,.35);
}
.steam-item:hover::before { opacity: .7; }

/* ======  ИЗОБРАЖЕНИЕ  ====== */
.steam-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.steam-item:hover img { transform: scale(1.08); }

/* ======  ОВЕРЛЕЙ  ====== */
.steam-item-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(0,0,0,.6) 75%,
    rgba(0,0,0,.85) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  color: #fff;
}

.steam-item h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}

.steam-item .hours {
  font-size: .85rem;
  font-weight: 500;
  opacity: .9;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.steam-item .hours::before {
  content: "\f1b6";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #00d4ff;
}

/* ======  АДАПТИВ  ====== */
@media (max-width: 600px) {
  .steam-list ul {
    grid-template-columns: 1fr;
  }
}

/* кнопка «Показать ещё» */
.load-more-games {
  display: block;
  margin: 2rem auto 0;
  padding: .6rem 1.8rem;
  border: none;
  border-radius: 999px;
  background: var(--clr-primary);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  transition: background .3s, transform .2s;
}

.load-more-games:hover {
  background: #0056b3;
  transform: translateY(-2px);
}
.load-more-games {
    display: block;
    margin: 1rem auto 0;
    padding: .5rem 1.5rem;
    border: none;
    border-radius: 999px;
    background: var(--clr-primary);
    color: #fff;
    cursor: pointer;
    transition: background .3s;
}

.load-more-games:hover {
    background: #0056b3;
}

/* 10. Каталог скриншотов (mini-gallery) */
.mini-gallery {
    margin-top: 2rem;
}


.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .8rem;
    margin-bottom: 1rem;
}

.mini-grid img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transition: transform .3s;
}

.mini-grid img:hover {
    transform: scale(1.03);
}

.button {
    display: inline-block;
    padding: .75rem 1.5rem;
    background: var(--clr-primary);
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: background .3s;
}

.button:hover {
    background: #0056b3;
}

/* 11. Footer */
footer {
    background: #343a40;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    font-size: .9rem;
    margin-top: 3rem;
}

/* === STEAM MODAL === */
.steam-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.steam-modal.hidden { display: none; }

.steam-modal-content {
  background: #fff;
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  padding: 2rem;
  position: relative;
}
.steam-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-size: 1.5rem;
  cursor: pointer;
}
.steam-modal-content h2 {
  margin-top: 0;
  color: var(--clr-primary);
}
.steam-modal-content p {
  margin: .5rem 0;
}

/* ----------  Сайдбар-скриншоты - опять  ---------- */
.mini-gallery {
    margin-top: 1.5rem;
}

.mini-gallery h2 {
    margin-top: 0;
    margin-bottom: .5rem;
    color: var(--clr-primary);
    font-size: 1.25rem;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
}

.mini-grid img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    transition: transform .25s ease, box-shadow .25s ease;
}

.mini-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

.mini-gallery .button {
    display: block;
    width: 100%;
    margin-top: .75rem;
    font-size: .9rem;
    padding: .5rem 0;
}
/* ----------  Сайдбар-скриншоты (вертикальный лента)  ---------- */
.mini-gallery {
    margin-top: 1.5rem;
    width: 100%;
}

.mini-grid {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.mini-grid img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,.15);
    transition: transform .3s ease, box-shadow .3s ease;
}

.mini-grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

.mini-gallery .button {
    display: block;
    width: 100%;
    margin-top: 1rem;
    font-size: .9rem;
    padding: .6rem 0;
}
.mini-gallery {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    width: 100%;
}


/* Ниже работа с сайд баром */
@media (min-width: 769px) {
    .hobby-info {
        position: relative;
    }

    .hobby-sidebar {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        pointer-events: none;
    }

    .hobby-sidebar > .sidebar-inner {
        position: absolute;
        top: 0;
        right: 0;
        width: 350px;
        height: 100%;
        overflow-y: scroll;
        scrollbar-width: none;
        scroll-behavior: smooth;
        pointer-events: auto;
        transform: translateY(0);
    }

    .hobby-sidebar > .sidebar-inner::-webkit-scrollbar {
        display: none;
    }

    [data-scroll] .hobby-sidebar > .sidebar-inner {
        transform: translateY(calc(var(--scroll-y, 0) * 0.22));
    }
}

/* mobile – normal flow */
@media (max-width: 768px) {
    .hobby-sidebar,
    .hobby-sidebar > .sidebar-inner {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
    }
}

.hobby-sidebar__rail {
    position: fixed;
    top: 110px;
    right: max(2rem, 50vw - 600px);
    width: 300px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    pointer-events: auto;
    z-index: 10;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--clr-primary) transparent;
    transition: transform .3s ease, opacity .3s ease;
}

.hobby-sidebar__rail::-webkit-scrollbar { width: 4px; }
.hobby-sidebar__rail::-webkit-scrollbar-thumb { background: var(--clr-primary); border-radius: 2px; }

/* 2. hide header when scrolling down */
@media (min-width: 769px) {
    body.scrolled-down .hobby-sidebar__rail {
        transform: translateY(-50px);
        opacity: 0;
    }
    .hobby-info {
        position: relative;
    }
}

/* 3. mobile fallback */
@media (max-width: 768px) {
    .hobby-sidebar__rail {
        position: static;
        width: 100%;
        max-height: none;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    .hobby-sidebar,
    .hobby-sidebar > .sidebar-inner {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
    }

}

/* 4. blocks inside the rail keep your style */
.sidebar-block {
    background: rgba(255,255,255,.9);
    margin-bottom: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    padding: 1.25rem 1.5rem;
    transition: transform .2s;
}
.sidebar-block:hover {
    transform: translateY(-2px);
}

.sidebar-block {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.sidebar-block h3 {
    margin-top: 0;
    color: var(--clr-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#galleryModal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  position-try: viewport;
  transform: none !important;
  contain: none !important;
  clip-path: none !important;
}

@supports not (position-try: viewport) {
  #galleryModal {
    transform: translate3d(0, 0, 0) !important;
  }
}
.modal-content {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}
.close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 1;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.modal-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform .2s;
}
.modal-item:hover img {
  transform: scale(1.03);
}
.load-more {
  margin: 1rem auto 0;
  display: block;
  padding: .5rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: #007bff;
  color: #fff;
  cursor: pointer;
}
/* ---------- Full-screen preview ---------- */
.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fullscreen img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* ===== Modern Cards ===== */
.game-cards.modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.game-card.modern {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .3s;
}

.game-card.modern:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}

.img-wrap:hover img {
  transform: scale(1.05);
}

.game-card.modern .info {
  padding: 1.2rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-card.modern h3 {
  font-size: 1.25rem;
  margin: 0 0 .5rem;
  color: var(--clr-primary);
}

.game-card.modern .platform {
  font-size: .9rem;
  color: #6c757d;
  margin-bottom: .75rem;
}

.game-card.modern .desc {
  font-size: .95rem;
  line-height: 1.5;
  color: #495057;
  margin-bottom: .75rem;
  flex: 1;
}

.stars {
  color: #ffc107;
  font-size: 1.1rem;
}
/* ---- Steam-карточки ---- */
.steam-list ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.steam-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s;
}

.steam-item:hover {
  transform: translateY(-3px);
}

.steam-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  color: #fff; /* будет перезаписано JS */
}

.steam-item h4 {
  font-size: 1.1rem;
  margin: 0 0 .25rem;
}
.steam-item .hours {
  font-size: .85rem;
  opacity: .9;
}

/* ---- Модалка ---- */

.steam-modal.hidden { display: none; }

.steam-modal-content {
  background: #1e293b;
  color: #e2e8f0;
  max-width: 600px;
  width: 100%;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.stat-card.modern img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.stat-card.modern h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.stat-card.modern p { margin: .5rem 0; font-size: 1rem; }

.img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
}

.game-card.modern .info {
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
}
.game-card.modern .info h3 { color: var(--clr-primary); margin: 0 0 .5rem; }
.game-card.modern .desc { font-size: .95rem; line-height: 1.4; color: #495057; margin-bottom: .5rem; }
.stars { color: #ffc107; font-size: 1.1rem; }

.top-vertical {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ---- кнопка «Посмотреть скриншоты» ---- */
.btn-screens {
  margin-top: .5rem;
  padding: .5rem 1rem;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  transition: background .3s;
}
.btn-screens:hover { background: #0056b3; }

/* ---- модалка скриншотов ---- */
.screens-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 1003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.screens-content {
  background: #1e293b;
  border-radius: 12px;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  text-align: center;
}
.screens-content img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.close-btn {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  padding: .5rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
}
.detail-drawer {
  grid-column: 1 / -1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  margin-top: 1.5rem;
  padding: 2rem;
  position: relative;
  animation: fadeIn .4s ease;
}
.detail-drawer.hidden { display: none; }

.detail-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #6c757d;
}
.detail-content img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.detail-content h2 { margin-top: 0; color: #007bff; }
.btn-screens {
  margin-top: 1rem;
  padding: .6rem 1.4rem;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}
.btn-screens:hover { background: #0056b3; }

.drawer-close {
  position: absolute;
  top: .75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
}
.drawer-content img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.drawer-content h2 { margin-top: 0; color: var(--clr-primary); }
.btn-screens {
    margin-top: 1rem;
    padding: .6rem 1.4rem;
    background: var(--clr-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
}
.btn-screens:hover { background: #0056b3; }

.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform .4s, box-shadow .4s;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 60%, var(--clr-primary-light) 100%);
  opacity: 0;
  transition: opacity .4s;
}
.stat-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 30px rgba(0,123,255,.35);
}
.stat-card:hover::after { opacity: .2; }
.stat-card:hover i { animation: fa-bounce .7s; }



/* ==== контейнер секции ==== */
.current-games-section {
  margin-top: 2.5rem;
}

.current-games-section h2 {
  margin-bottom: 1rem;
  color: var(--clr-primary);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ==== каждая карточка ==== */
.current-game-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: .75rem 1rem;
  align-items: center;
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .3s ease;
  cursor: pointer;
  user-select: none;
}

@media (max-width: 480px) {
  .current-game-card {
    grid-template-columns: 80px 1fr;
    padding: .75rem 1rem;
  }
}

.current-game-card:hover {
  box-shadow: var(--shadow-hover);
}

/* ==== изображение фиксированного размера ==== */
.current-game-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

@media (max-width: 480px) {
  .current-game-card img {
    width: 80px;
    height: 80px;
  }
}

/* ==== текст и прогресс ==== */
.current-info {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .25rem;
}

.current-info h3 {
  margin: 0;
  font-size: clamp(1rem, 1.1vw, 1.2rem);
  font-weight: 700;
  color: var(--clr-primary);
  line-height: 1.2;
}

.progress-label {
  margin: 0;
  font-size: .85rem;
  color: #495057;
}

.progress-bar {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  border-radius: 3px;
  transition: width .6s ease;
}

.meta {
  margin: 0;
  font-size: .8rem;
  color: #6c757d;
}

/* ==== аккордеон-контент ==== */
.current-drawer {
  grid-column: 1 / 3;
  background: rgba(0, 0, 0, .03);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
}
.current-game-card.open {
  grid-template-rows: auto 1fr;
}
.current-game-card.open .current-drawer {
  max-height: 300px;
  max-height: none;
  padding: .75rem 1.25rem 1rem;
  padding: .75rem 1.25rem 1rem;
}

.current-drawer p {
  margin: .2rem 0;
  font-size: .85rem;
  color: #334155;
}

.current-drawer strong {
  color: #0f172a;
}

/* ==== кнопка «Скриншоты» ==== */
.btn-screens {
  margin-top: .5rem;
  padding: .4rem 1rem;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .3s;
}

.btn-screens:hover {
  background: #0056b3;
}

/* ===== общие стили для блоков ===== */
.challenge-block,
.achievement-block {
  margin-bottom: 1rem;
}

.challenge-block h4,
.achievement-block h4 {
  margin: 0 0 .5rem;
  font-size: .95rem;
  color: var(--clr-primary);
}

.custom-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.challenge-item,
.achievement-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem .75rem;
  align-items: center;
  font-size: .8rem;
  margin-bottom: .4rem;
}

.label {
  grid-column: 1 / 2;
  color: #334155;
}

.mini-bar {
  grid-column: 1 / 3;
  height: 5px;
  background: #e9ecef;
  border-radius: 2.5px;
  overflow: hidden;
}

.mini-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  border-radius: 2.5px;
  transition: width .3s ease;
}

/* для полностью выполненных целей */
.mini-bar.done .mini-progress {
  background: var(--clr-secondary);
}

.fa-check-circle {
  color: var(--clr-secondary);
  font-size: 1rem;
}

.percent {
  font-size: .75rem;
  color: #6c757d;
  justify-self: end;
}
.speech,
.speech-small {
  margin: .5rem 0 1.25rem;
  padding: .75rem 1rem;
  background: rgba(0,123,255,.06);
  border-left: 3px solid var(--clr-primary);
  border-radius: 6px;
  font-style: italic;
  font-size: .9rem;
  color: #334155;
}

.speech-small {
  margin: 0 0 .75rem;
  font-size: .8rem;
}
.speech.expandable {
  position: relative;
  margin: .5rem 0 1.25rem;
  padding: .75rem 1rem;
  background: rgba(0,123,255,.06);
  border-left: 3px solid var(--clr-primary);
  border-radius: 6px;
  font-style: italic;
  font-size: .9rem;
  color: #334155;
  cursor: pointer;
  overflow: hidden;
}
.speech.expandable.open {
  max-height: 9999px;
  padding: .75rem 1rem;
}
.speech-preview {
  display: inline;
}

.speech-full {
  display: none;
}

.speech.expandable.open .speech-preview {
  display: none;
}

.speech.expandable.open .speech-full {
  display: inline;
}
.ach-item {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid #eee;
}
.ach-item:last-child { border-bottom: none; }
.ach-item.unlocked { color: var(--clr-secondary); }
.ach-item.locked   { color: #6c757d; }
.ach-name { font-weight: 600; }
.ach-meta, .ach-date { display: block; font-size: .8rem; color: #6c757d; }

/* Полноэкранная модалка достижений */
.achievements-modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,.85) !important;
  z-index: 10002;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
}

.achievements-modal .modal-content {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  overflow-y: auto;
  padding: 3rem 2rem 2rem;
  display: flex;
  flex-direction: column;
}

.achievements-modal .close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.2rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color .3s;
  z-index: 2;
}
.achievements-modal .close:hover { color: #fff; }

#allAchievementsList {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 1rem 0 2rem;
}

.ach-item {
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ach-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,123,255,.25);
}
.ach-item.unlocked {
  border-left: 4px solid var(--clr-secondary);
}
.ach-item.locked {
  border-left: 4px solid #6c757d;
  opacity: .7;
}
.ach-item i {
  font-size: 1.8rem;
  min-width: 36px;
  text-align: center;
}
.ach-item.unlocked i { color: var(--clr-secondary); }
.ach-item.locked   i { color: #6c757d; }
.ach-item strong {
  font-size: 1.05rem;
  margin-bottom: .2rem;
  display: block;
}
.ach-item small {
  font-size: .85rem;
  color: #94a3b8;
}
.ach-date {
  display: block;
  margin-top: .4rem;
  font-size: .8rem;
  color: #cbd5e1;
}
.game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-right: .75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.ach-drawer {
  margin-top: 1rem;
  display: grid;
  gap: .75rem;
}
.ach-drawer h4 {
  margin: 0 0 .5rem;
  font-size: 1rem;
  color: var(--clr-primary);
}
.ach-mini {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
}
.ach-mini i { color: var(--clr-secondary); }
.ach-mini.pending i { color: #6c757d; }
.ach-drawer {
  margin-top: 1rem;
  display: grid;
  gap: .75rem;
}
.ach-drawer h4 {
  margin: 0 0 .5rem;
  font-size: 1rem;
  color: #fff;
}
.ach-mini {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: #eee;
}
.ach-mini i { color: #28a745; }
.ach-mini.pending i { color: #6c757d; }
.ach-mini i.fa-check-circle {
  color: var(--clr-secondary);
}

.ach-mini.pending i {
  color: #dc3545;
}
.ach-mini {
  background: rgba(255, 255, 255, .12);
  padding: .4rem .6rem;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.ach-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
  margin-top: .5rem;
}
.ach-collapse.open {
  max-height: 1000px;
}
.ach-toggle {
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e2e8f0;
  user-select: none;
}
.ach-toggle i { transition: transform .3s; }
.ach-toggle.open i { transform: rotate(90deg); }

.ach-toggle-block {
  margin-top: .75rem;
}
.ach-toggle-btn {
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e2e8f0;
  user-select: none;
}
.ach-toggle-btn i { transition: transform .3s; }
.ach-toggle-btn.open i { transform: rotate(90deg); }

.ach-toggle-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
  margin-top: .5rem;
}
.ach-toggle-list.open {
  max-height: 1000px;
}

.ach-mini {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  margin-bottom: .4rem;
}
.ach-accordion {
  margin-top: 1rem;
}
.ach-btn {
  width: 100%;
  padding: .9rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .3s, box-shadow .3s;
}
.ach-btn.done  { background: #28a745; color: #fff; }
.ach-btn.chal  { background: #007bff; color: #fff; }

.ach-btn:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.ach-btn i {
  transition: transform .3s;
}
.ach-btn.open i {
  transform: rotate(90deg);
}

.ach-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease;
  margin-top: .5rem;
}
.ach-panel.open {
  max-height: 1000px;
}
.ach-row {
  padding: .6rem .8rem;
  font-size: .95rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ach-row:last-child { border-bottom: none; }
.ach-row i { width: 18px; }
.ach-row.done  i { color: #28a745; }
.ach-row.pending i { color: #dc3545; }
.ach-btn {
  width: 100%;
  padding: .9rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000;
  background: #e2e8f0;
  transition: background .3s, box-shadow .3s;
} 
.ach-btn.done  { background: #bbbbbb; }
.ach-btn.chal  { background: #b9b9b9; }

.ach-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.ach-btn i     { transition: transform .3s; }
.ach-btn.open i { transform: rotate(90deg); }

.ach-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease;
}
.ach-panel.open { max-height: 1000px; }

.ach-row {
  padding: .6rem .8rem;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.ach-row.done  i { color: #28a745; }
.ach-row.pending i { color: #dc3545; }
.ach-btn,
.ach-toggle-btn {
  color: #000 !important;
  background: #e2e8f0;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}
.ach-btn,
.ach-toggle-btn,
.ach-panel,
.ach-toggle-list {
  transition: all .4s cubic-bezier(.4,.0,.2,1);
}
.current-info { cursor:pointer; user-select:none; }
#toggleSteam {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
}
/* список ссылок в сайдбаре */

/* контейнер */
.genre-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .75rem 0 0;
}

.genre-list li {
  position: relative;
  padding: .6rem 1rem .6rem 2.2rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 6px rgba(102,126,234,.25);
  transition: transform .25s, box-shadow .25s;
}

.genre-list li::before {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}*

.genre-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(102,126,234,.45);
}

/* общий контейнер в сайдбаре */
.sidebar-block .genre-list:has(a[href*="steam"], a[href*="discord"]) {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.sidebar-block .genre-list li:has(a[href*="steam"]),
.sidebar-block .genre-list li:has(a[href*="discord"]) {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .75rem 1rem;
  font-weight: 600;
  transition: .25s;
}

.sidebar-block .genre-list li:has(a[href*="steam"]) {
  border-left: 4px solid #1b2838;
}
.sidebar-block .genre-list li:has(a[href*="discord"]) {
  border-left: 4px solid #5865F2;
}

.sidebar-block .genre-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* иконки */
.sidebar-block .genre-list li a {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: #111827;
}

.sidebar-block .genre-list li i {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

.sidebar-block .genre-list li a[href*="steam"] i {
  color: #1b2838;
}
.sidebar-block .genre-list li a[href*="discord"] i {
  color: #5865F2;
}


/* Платформы */
.platform-tag {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  color: #fff;
  font-size: 1.4rem;
  transition: .3s;
  position: relative;
}

/* всплывающая подпись при наведении */
.platform-tag::after {
  content: attr(data-label);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: .25rem .6rem;
  border-radius: 4px;
  font-size: .7rem;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
}

.platform-tag:hover::after { opacity: 1; }

/* цвета платформ */
.platform-tag:nth-child(1){ background:#0078d4; } /* PC */
.platform-tag:nth-child(2){ background:#1b2838; } /* Steam */
.platform-tag:nth-child(3){ background:#5865F2; } /* Discord */

.platform-tag:hover {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 0 8px currentColor);
}









/* Карточки ТОП 5 игр */
/* НЕ ДАЙ БОГ ТЫ ТРОНЕШЬ ЧТО ТО ИЗ ЭТОЙ ОБЛАСТИ, 5 часов правок ушли не зря*/ 
.top-card {
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    transition: transform .35s ease, filter .35s ease;
    filter: blur(1px);
}
.top-card h3 {
    font-weight: 700;
    font-size: 2rem;
    margin: 0 0 .25rem;
    filter: blur(0px);
}
.top-card .details {
    font-weight: 800;
    font-size: .9rem;
    opacity: .9;
    filter: blur(0px);
}
.top-card-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0 2rem;
}
.top-card-wrapper .top-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: filter .35s ease;
}
.top-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
}
.top-card:hover { transform: scale(1.02); filter: blur(0px);}
.top-card-bg {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center;
    filter: blur(2px);
    transition: filter .35s ease;
    filter: inherit;
    z-index: 1;
}
.top-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    color: #fff;
    text-shadow:    -1px -1px 0 #000,
                    1px -1px 0 #000,
                    -1px  1px 0 #000,
                    1px  1px 0 #000;
    transition: opacity .35s ease;
}
.top-card-drawer {
    max-height: 0; 
    overflow: hidden; 
    transition: max-height .40s ease, padding .40s ease; 
    background: rgba(0,0,0,.55); 
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 0 1.5rem;
}
.top-card .top-card-overlay h3,
.top-card .top-card-overlay .details {
    color: #fff;
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}
.top-card.open .top-card-overlay { opacity: 0; transition: opacity .3s ease;}
.top-card-drawer.open { max-height: 600px; padding: 1.5rem 2rem;}
.top-card-wrapper.open .top-card-drawer { max-height: 600px; padding: 1.5rem 2rem;}
.top-card-wrapper.open .top-card-overlay { opacity: 0;}
.top-card-wrapper.open .top-card { filter: blur(0px); transform: scale(1.02);}
.top-card-wrapper.open .top-card-bg { filter: blur(0px);}
/* КОД ПИСАТЬ ДО ЭТИХ БЛОКОВ */