:root {
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-shit: #b190ff;
  --md-sys-color-shit-light: #c8b0ff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-on-primary-container: #eaddff;
  --md-sys-color-secondary: #ccc2dc;
  --md-sys-color-on-secondary: #332d41;
  --md-sys-color-secondary-container: #4a4458;
  --md-sys-color-on-secondary-container: #e8def8;
  --md-sys-color-surface: #141218;
  --md-sys-color-on-surface: #e6e0e9;
  --md-sys-color-on-surface-light: #e7e4e9;
  --md-sys-color-surface-variant: #49454f;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-outline: #938f99;
  --md-sys-color-surface-container-low: #1d1b20;
  --md-sys-color-surface-container: #211f26;
  --md-sys-color-surface-container-high: #2b2930;
  --md-sys-color-surface-container-highest: #36343b;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
}

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

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  line-height: 1.6;
  overflow-x: hidden;
  -ms-overflow-style: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::-webkit-scrollbar {
  display: none;
}

#tg {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

a {
  text-decoration: none;
  color: var(--md-sys-color-on-surface-light);
  font-weight: 500;
}

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

.header {
  background-color: hsla(252, 12%, 8%, 0.4);
  padding: 16px 0;
  box-shadow: 0 1px 8px #131217;
  backdrop-filter: blur(15px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 40px;
}

.logo {
  font-size: 23px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.back-button {
  display: none;
  align-items: center;
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 20px;
  transition: background-color 0.2s;
  position: absolute;
  left: 0;
}

.back-button:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.back-button svg {
  margin-right: 8px;
}

.main {
  padding: 32px 0;
  flex: 1;
}

.page-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--md-sys-color-on-surface);
}

.page-description {
  font-size: 17px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 32px;
  max-width: 600px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* .card {
  background-color: var(--md-sys-color-surface-container);
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
} */

.card {
  background-color: var(--md-sys-color-surface-container);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card:hover .card-content {
  background-color: rgba(208, 188, 255, 0.08);
}

.card-media {
  width: 100%;
  height: 200px;
  background-color: var(--md-sys-color-surface-container-high);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}

.card-media svg,
.card-media .icon {
  color: var(--md-sys-color-primary-container);
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* .card-content {
  padding: 20px;
  transition: background-color 0.2s ease;
  border-radius: 0 0 24px 24px;
} */

.card-content {
  padding: 20px;
  flex-grow: 1;
  transition: background-color 0.2s ease;
  border-radius: 0 0 24px 24px;
}

.card-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 5px;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.4;
  opacity: 0.8;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.card-subtitle.card-link {
  color: var(--md-sys-color-primary) !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  opacity: 1 !important;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.card-subtitle.card-link:hover {
  color: var(--md-sys-color-shit-light) !important;
  text-shadow: 0 0 8px rgba(208, 188, 255, 0.4);
}

.card-subtitle.card-link:active {
  color: var(--md-sys-color-primary) !important;
}

.download-icon {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background-color: var(--md-sys-color-primary);
  color: #444;
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  z-index: 3;
}

.download-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.card:hover .download-icon {
  opacity: 1;
}

.mod-tags {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: row;
  gap: 6px;
  z-index: 3;
}

.mod-tag {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.636);
}

.lazy-media {
  transition: opacity 0.3s ease;
  background: var(--md-sys-color-surface-variant);
}

.lazy-media.loaded {
  opacity: 1 !important;
}

.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--md-sys-color-outline);
  border-top: 2px solid var(--md-sys-color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }

  .page-title {
    font-size: 28px;
  }
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--md-sys-color-surface-container-high);
  border-top: 4px solid var(--md-sys-color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

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

.footer {
  text-align: center;
  padding: 20px 0;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg aria-hidden='true' width='100%25' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpattern id='squiggle' width='91' height='8' patternUnits='userSpaceOnUse'%3E%3Cg clip-path='url(%23clip0_2426_11367)'%3E%3Cpath d='M114 4c-5.067 4.667-10.133 4.667-15.2 0S88.667-.667 83.6 4 73.467 8.667 68.4 4 58.267-.667 53.2 4 43.067 8.667 38 4 27.867-.667 22.8 4 12.667 8.667 7.6 4-2.533-.667-7.6 4s-10.133 4.667-15.2 0S-32.933-.667-38 4s-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0-10.133 4.667-15.2 0-10.133-4.667-15.2 0' stroke='%23D0BCFF' stroke-linecap='square'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2426_11367'%3E%3Crect width='91' height='8' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/pattern%3E%3Crect width='100%25' height='100%25' fill='url(%23squiggle)'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}

.footer a {
  color: var(--md-sys-color-shit-light);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}