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

:root {
  --bg-dark: #000;
  --bg-panel: rgba(255, 255, 255, 0.1);
  --bg-panel-hover: rgba(255, 255, 255, 0.16);
  --text-main: #fff;
  --text-soft: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.65);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.28);
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hard: 0 12px 24px rgba(0, 0, 0, 0.2);
  --panel-blur: blur(10px);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: #000;
  border-bottom: 1px solid rgb(34, 34, 34);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-content {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.logo {
  height: 45px;
  width: auto;
  object-fit: contain;
}

.site-name {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.navigation {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.menu-dropdown {
  position: relative;
}

.menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 0;
  color: #d1d5db;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.menu-trigger svg,
.hamburger-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

.menu-trigger:hover,
.hamburger-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.menu-dropdown:hover .menu-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-dropdown:hover .menu-trigger svg {
  transform: rotate(180deg);
}

.menu-dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.menu-dropdown-item {
  padding: 10px 12px;
  border-radius: 6px;
  color: #d1d5db;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hamburger-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d1d5db;
  cursor: pointer;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.mobile-menu-content {
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  background: #1f2937;
  border-bottom: 2px solid #374151;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: slideDown 0.3s ease;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #374151;
  background: rgba(255, 255, 255, 0.03);
}

.mobile-menu-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 4px;
}

.mobile-menu-item {
  padding: 16px 20px;
  border-radius: 10px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.mobile-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.home {
  min-height: calc(100vh - 70px);
  position: relative;
}

.home.has-background::before {
  content: "";
  position: fixed;
  inset: 70px 0 0;
  background-image: url("https://apsladas.site/storage/app/public/settings/home_background_1768266828.jpg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -1;
  pointer-events: none;
}

.sponsors-banner-section,
.gifs-section,
.social-section,
.sponsors-section {
  width: 100%;
  background: transparent;
  box-sizing: border-box;
}

.sponsors-banner-section {
  padding: 20px 20px 0;
}

.gifs-section,
.social-section,
.sponsors-section {
  padding: 40px 20px 0;
}

.sponsors-banner-container,
.gifs-container,
.social-container,
.sponsors-container,
.footer-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.sponsors-banner-image {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.gifs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.gif-item,
.social-link-card,
.sponsor-item {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  transition: all 0.3s ease;
}

.gif-item {
  border-radius: 12px;
  overflow: hidden;
}

.gif-item:hover,
.social-link-card:hover,
.sponsor-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hard);
  border-color: var(--line-strong);
  background: var(--bg-panel-hover);
}

.gif-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.social-links-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
}

.social-link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 16px;
  min-width: 0;
}

.social-link-icon-wrapper {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
  transition: transform 0.3s ease;
}

.social-link-card:hover .social-link-icon-wrapper {
  transform: scale(1.1);
}

.social-link-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.social-link-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.social-link-platform {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.social-link-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-link-arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
}

.social-link-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}

.sponsor-item {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 12px;
}

.sponsor-image {
  max-width: 100%;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.footer {
  width: 100%;
  margin-top: auto;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-logo {
  max-width: 300px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.footer-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.footer-copyright {
  width: 100%;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright-text,
.footer-provider {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.provider-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.75);
  animation: fadeIn 0.3s ease;
}

.popup-content {
  position: relative;
  width: 100%;
  max-width: 90%;
  max-height: 90vh;
  padding: 20px 0;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
}

.popup-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1a202c;
  font-size: 24px;
  cursor: pointer;
}

.popup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 20px;
}

.popup-link {
  display: block;
  width: 100%;
}

.popup-gif-image {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.overlay-open {
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1024px) {
  .gifs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .social-links-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .sponsors-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .hamburger-button {
    display: inline-flex;
  }

  .header-container,
  .gifs-section,
  .social-section,
  .sponsors-section,
  .sponsors-banner-section,
  .footer {
    padding-left: 15px;
    padding-right: 15px;
  }

  .gifs-section,
  .social-section,
  .sponsors-section {
    padding-top: 30px;
  }

  .site-name {
    font-size: 20px;
  }

  .logo {
    height: 40px;
  }

  .social-links-grid,
  .sponsors-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .social-link-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 12px 8px;
  }

  .social-link-icon-wrapper {
    width: 36px;
    height: 36px;
  }

  .social-link-icon-wrapper svg {
    width: 18px;
    height: 18px;
  }

  .social-link-title {
    font-size: 11px;
    white-space: normal;
  }

  .social-link-arrow {
    display: none;
  }

  .sponsor-item {
    min-height: 100px;
    padding: 16px;
  }

  .sponsor-image {
    max-height: 80px;
  }

  .popup-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 10px;
  }
}

@media (max-width: 480px) {
  .header-container,
  .gifs-section,
  .social-section,
  .sponsors-section,
  .sponsors-banner-section,
  .footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .gifs-section,
  .social-section,
  .sponsors-section {
    padding-top: 24px;
  }

  .site-name {
    font-size: 18px;
  }

  .logo {
    height: 35px;
  }

  .gifs-grid,
  .social-links-grid,
  .sponsors-grid {
    gap: 8px;
  }

  .social-link-icon-wrapper {
    width: 32px;
    height: 32px;
  }

  .social-link-icon-wrapper svg {
    width: 16px;
    height: 16px;
  }
}
