 :root {
   --bg: #0d0d1a;
   --surface: #1e1e35;
   --surface-light: #2a2a45;
   --text: #f0f0ff;
   --text-muted: #b8b8e0;
   --accent: #7a6aec;
   --accent-hover: #8d7ff0;
   --border: #444466;
   --shadow: rgba(0, 0, 0, 0.5);
 }

 * {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
 }

 body {
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
   background-color: var(--bg);
   color: var(--text);
   line-height: 1.6;
 }

 .container {
   max-width: 1400px;
   margin: 0 auto;
   padding: 0 1.5rem;
 }

 /* Header */
 header {
   padding: 1.5rem 0;
   border-bottom: 1px solid var(--border);
 }

 .header-content {
   display: flex;
   justify-content: space-between;
   align-items: center;
   flex-wrap: wrap;
   gap: 1rem;
 }

 .logo {
   font-size: 1.8rem;
   font-weight: 700;
   letter-spacing: -0.5px;
 }

 .logo span {
   color: var(--accent);
 }

 .header-right {
   display: flex;
   gap: 1rem;
   align-items: center;
 }

 .social-links {
   display: flex;
   gap: 0.8rem;
 }

 .social-link {
   display: inline-flex;
   width: 38px;
   height: 38px;
   border-radius: 50%;
   background: var(--surface-light);
   color: #d0d0ff;
   justify-content: center;
   align-items: center;
   text-decoration: none;
   transition: all 0.25s ease;
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
 }

 .social-link:hover {
   background: var(--accent);
   color: white;
   transform: translateY(-2px);
   box-shadow: 0 4px 10px rgba(122, 106, 236, 0.4);
 }

 .donate-btn {
   padding: 0.65rem 1.3rem;
   background: var(--accent);
   color: white;
   border: none;
   border-radius: 6px;
   font-weight: 600;
   cursor: pointer;
   transition: background 0.2s, transform 0.15s;
 }

 .donate-btn:hover {
   background: var(--accent-hover);
   transform: translateY(-2px);
 }

 /* Hero / Intro */
 .hero {
   text-align: center;
   padding: 3rem 0 2rem;
   max-width: 800px;
   margin: 0 auto;
 }

 .hero h1 {
   font-size: 2.4rem;
   margin-bottom: 1rem;
   color: #ffffff;
 }

 .hero p {
   font-size: 1.15rem;
   color: var(--text-muted);
   margin-bottom: 1.2rem;
 }

 .hero-tagline {
   display: inline-block;
   background: rgba(122, 106, 236, 0.12);
   color: var(--accent);
   padding: 0.35rem 1rem;
   border-radius: 20px;
   font-size: 0.95rem;
   font-weight: 600;
   margin-top: 0.8rem;
 }

 /* Games Section */
 .section-title {
   font-size: 2.1rem;
   margin: 2.5rem 0 1.8rem;
   text-align: center;
   color: #ffffff;
 }

 .games-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
   gap: 1.8rem;
   margin-bottom: 3rem;
 }

 .game-card {
   background: var(--surface);
   border-radius: 12px;
   overflow: hidden;
   box-shadow: 0 6px 18px var(--shadow);
   transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.2s;
   cursor: pointer;
   border: 1px solid var(--border);
 }

 .game-card:hover {
   transform: translateY(-6px);
   box-shadow: 0 10px 26px rgba(122, 106, 236, 0.35);
   background: #23233f;
 }

 .game-image {
   width: 100%;
   height: 160px;
   background: #2b2b4a;
   display: flex;
   align-items: center;
   justify-content: center;
   color: var(--text-muted);
   font-size: 1rem;
   font-weight: 500;
   overflow: hidden;
   border-radius: 12px;
 }

 .game-image img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   object-position: center;
 }

 .game-content {
   padding: 1.3rem;
 }

 .game-title {
   font-size: 1.35rem;
   margin-bottom: 0.6rem;
   color: #ffffff;
 }

 .game-desc {
   font-size: 0.98rem;
   color: var(--text-muted);
 }

 /* Modal */
 .modal-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(7, 5, 20, 0.82);
   display: flex;
   justify-content: center;
   align-items: center;
   z-index: 1000;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.35s, visibility 0.35s;
 }

 .modal-overlay.active {
   opacity: 1;
   visibility: visible;
 }

 .modal {
   width: 92%;
   max-width: 1000px;
   padding: 0;
   display: flex;
   flex-direction: column;
   max-height: 90vh;
   background: var(--surface-light);
   border-radius: 12px;
   /* padding: 1.6rem; */
   transform: scale(0.94);
   transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
   border: 1px solid var(--border);
 }

 .modal-header {
   padding: 1.4rem 1.6rem;
   border-bottom: 1px solid var(--border);
   display: flex;
   justify-content: space-between;
   align-items: center;
 }

 .modal-title {
   font-size: 1.55rem;
   color: #f8f8ff;
   margin: 0;
 }

 .modal-body {
   display: flex;
   gap: 1.8rem;
   padding: 1.6rem;
   overflow: hidden;
   flex: 1;
 }

 .modal-preview {
   flex: 1;
   min-width: 0;
   background: #18182a;
   border-radius: 10px;
   overflow: hidden;
   display: flex;
   align-items: center;
   justify-content: center;
   aspect-ratio: 16/9;
   position: relative;
 }

 .modal-preview iframe {
   width: 100%;
   height: 100%;
   border: none;
   display: block;
 }

 .preview-placeholder {
   text-align: center;
   color: var(--text-muted);
   font-size: 1.1rem;
   padding: 1.5rem;
   line-height: 1.5;
 }

 .modal-platforms {
   flex: 0 0 280px;
   /* фиксированная ширина для платформ */
   display: flex;
   flex-direction: column;
   overflow: auto;
 }

 .platforms {
   display: flex;
   flex-direction: column;
   gap: 0.9rem;
 }

 .modal-footer {
   padding: 0.8rem 1.6rem 1.4rem;
   border-top: 1px solid var(--border);
   text-align: center;
   font-size: 0.92rem;
   color: var(--text-muted);
   display: none;
   /* по умолчанию скрыт */
 }

 .legal-link {
   color: var(--accent);
   text-decoration: none;
   transition: opacity 0.2s;
 }

 .legal-link:hover {
   opacity: 0.85;
   text-decoration: underline;
 }

 .close-btn {
   background: none;
   border: none;
   font-size: 1.6rem;
   color: #c0c0e0;
   cursor: pointer;
   transition: color 0.2s;
 }

 .close-btn:hover {
   color: var(--accent);
 }

 .platforms {
   display: flex;
   flex-direction: column;
   gap: 0.9rem;
 }

 .platform-btn {
   display: flex;
   align-items: center;
   gap: 1rem;
   padding: 1rem;
   background: var(--surface);
   border: none;
   border-radius: 8px;
   color: var(--text);
   text-align: left;
   font-size: 1.05rem;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s ease;
   border: 1px solid transparent;
 }

 .platform-btn:hover {
   background: var(--accent);
   color: white;
   border-color: rgba(255, 255, 255, 0.1);
 }

 .platform-icon {
   width: 26px;
   height: 26px;
   font-size: 1.2rem;
 }

 /* Footer */
 footer {
   background: var(--surface);
   padding: 1.8rem 0 1.5rem;
   border-top: 1px solid var(--border);
   margin-top: 2rem;
 }

 .footer-content {
   display: flex;
   flex-wrap: wrap;
   justify-content: space-between;
   align-items: center;
   gap: 1rem;
   font-size: 0.95rem;
   color: var(--text-muted);
 }

 .copyright {
   flex: 1 1;
 }

 .footer-links {
   display: flex;
   gap: 1.2rem;
   flex: 0 0 auto;
 }

 .footer-link {
   color: var(--text-muted);
   text-decoration: none;
   transition: color 0.2s;
 }

 .footer-link:hover {
   color: var(--accent);
 }

 .modal-preview iframe {
   aspect-ratio: auto;
   height: 100%;
   width: 100%;
 }

 ::-webkit-scrollbar {
   width: 10px;
   /* ширина для вертикального */
   height: 10px;
   /* высота для горизонтального */
 }

 ::-webkit-scrollbar-track {
   background: transparent;
   border-radius: 5px;
 }

 ::-webkit-scrollbar-thumb {
   background: rgba(122, 106, 236, 0.4);
   /* --accent с прозрачностью */
   border-radius: 5px;
   border: 2px solid transparent;
   background-clip: padding-box;
   /* чтобы border-radius работал с border */
 }

 ::-webkit-scrollbar-thumb:hover {
   background: rgba(122, 106, 236, 0.7);
 }

 /* Для активной прокрутки (необязательно, но красиво) */
 ::-webkit-scrollbar-thumb:active {
   background: rgba(122, 106, 236, 0.9);
 }

 /* === Поддержка Firefox (с версии 64+) === */
 * {
   scrollbar-width: thin;
   /* 'auto' | 'thin' | 'none' */
   scrollbar-color: rgba(122, 106, 236, 0.4) transparent;
 }

 body.no-scroll {
   overflow: hidden;
   padding-right: var(--scrollbar-compensation, 0px);
 }

 .scrollable-inside-modal {
   overflow: auto;
   -webkit-overflow-scrolling: touch;
 }


/* === DONATE MODAL (.d-box) === */
.d-box-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 5, 20, 0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.d-box-overlay.active {
  opacity: 1;
  visibility: visible;
}

.d-box {
  width: 92%;
  max-width: 500px;
  max-height: 98%;
  background: var(--surface-light);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.d-box-header {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.d-box-title {
  font-size: 1.55rem;
  color: #f8f8ff;
  margin: 0;
}

.d-box-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #c0c0e0;
  cursor: pointer;
  transition: color 0.2s;
}

.d-box-close:hover {
  color: var(--accent);
}

.d-box-body {
  padding: 1.8rem 1.6rem;
  overflow: auto;
}

.d-box-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}

@media (max-width: 480px) {
  .d-box-amounts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.d-box-amount-btn {
  padding: 0.9rem 0.6rem;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.d-box-amount-btn:hover {
  background: rgba(122, 106, 236, 0.1);
  transform: translateY(-2px);
}

.d-box-amount-btn.selected {
  background: var(--accent);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(122, 106, 236, 0.3);
}

.d-box-custom {
  margin-bottom: 1.8rem;
}

.d-box-custom label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.d-box-custom-input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

.d-box-custom-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(122, 106, 236, 0.2);
}

.d-box-footer {
  padding: 0 1.6rem 1.6rem;
  text-align: center;
}

.d-box-donate-btn {
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.d-box-donate-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.d-box-donate-btn:disabled {
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
}


@media (hover: none) and (pointer: coarse) {
  /* Только устройства с сенсорным экраном */
  button,
  .platform-btn,
  .d-box-amount-btn,
  .donate-btn,
  .social-link,
  .footer-link,
  a {
    outline: none !important;
    -webkit-tap-highlight-color: transparent; /* убирает серый блик при тапе в Safari/Chrome iOS */
  }
}

/* И дополнительно — глобально убираем фокус-кольцо при клике/тапе, но оставляем при клавиатурной навигации */
*:focus:not(:focus-visible) {
  outline: none !important;
}


 @media (hover: hover) {
   *:hover {
     scrollbar-color: rgba(122, 106, 236, 0.7) transparent;
   }
 }

 /* Responsive */
 @media (max-width: 1200px) {
   .games-grid {
     grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
   }
 }

 @media (max-width: 768px) {
   .modal-body {
     flex-direction: column;
   }

   .modal-preview {
     min-height: 50vw;
     overflow: hidden;
   }

   .modal-platforms {
     flex: 1;
     min-height: 200px;
   }

   .modal-title {
     font-size: 0.8rem;
   }

   .header-content {
     flex-direction: column;
     text-align: center;
   }

   .hero h1 {
     font-size: 2rem;
   }

   .hero p {
     font-size: 1.05rem;
   }

   .games-grid {
     grid-template-columns: repeat(2, 1fr);
     gap: 1.4rem;
   }

   .footer-content {
     flex-direction: column;
     text-align: center;
   }

   .footer-links {
     justify-content: center;
   }
 }

 @media (max-width: 520px) {
   .games-grid {
     grid-template-columns: 1fr;
   }
 }