:root {
  --bg-color: #050505;
  --accent-primary: #E96D77;
  --accent-secondary: #ff9a9e;
  --brand-bg: #341952;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  z-index: 1;
}

.background-radial {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% -20%, var(--brand-bg) 0%, #050505 80%);
  z-index: -1;
}

.background-texture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('texture.png');
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.glow-text {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 15px rgba(233, 109, 119, 0.3));
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 600px;
}

.brand-logo {
  width: 420px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(233, 109, 119, 0.4));
  transition: transform 0.5s ease;
  cursor: pointer;
}

.brand-logo:hover {
  transform: scale(1.05) rotate(5deg);
}

.hero h1 {
  font-family: 'Germania One', cursive;
  letter-spacing: 2px;
}

/* Search & Filter Bar */
.search-filter-bar {
  width: 100%;
  max-width: 1000px;
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 0 10px;
}

.search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 15px;
  color: var(--accent-secondary);
  pointer-events: none;
  z-index: 10;
  opacity: 0.8;
}

.search-box input {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 12px 15px 12px 45px;
  border-radius: 15px;
  outline: none;
  transition: all 0.3s ease;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(233, 109, 119, 0.2);
}

.filter-group {
  display: flex;
  gap: 15px;
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255, 255, 255, 0.08) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: pulse 1.5s infinite;
  border-radius: 8px;
}

@keyframes pulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 20px;
  margin-bottom: 10px;
  width: 80%;
}

.skeleton-title {
  height: 30px;
  margin-bottom: 15px;
  width: 60%;
}

.skeleton-img {
  width: 100%;
  height: 200px;
  border-radius: 0;
}

/* Controls Bar */
.controls-bar {
  width: 100%;
  max-width: 1000px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 10px;
}

.view-switcher {
  display: flex;
  gap: 10px;
}

.switch-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.switch-btn:hover,
.switch-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 13px 35px 13px 15px;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
}

.custom-select select option {
  background-color: #1a1a1a;
  color: white;
}

.custom-select:after {
  content: '▼';
  font-size: 0.7rem;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-secondary);
  pointer-events: none;
}

.custom-select select:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Games View */
.games-container {
  width: 100%;
  max-width: 1000px;
}

/* List View (Standard) */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Grid View */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.item {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease;
  box-shadow: var(--shadow);
}

.grid-view .item {
  flex-direction: column;
}

.item:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--accent-primary);
}

.img-container {
  width: 30%;
  position: relative;
  overflow: hidden;
}

.grid-view .img-container {
  width: 100%;
  height: 200px;
}

.img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.item:hover .img-container img {
  transform: scale(1.1);
}

.info {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.info-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.grid-view .info-header h2 {
  font-size: 1.2rem;
}

.genre {
  color: var(--accent-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
}

.meta-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.release-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.release-date b {
  color: var(--text-primary);
}

.action {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(233, 109, 119, 0.4);
  text-align: center;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  box-shadow: none;
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 109, 119, 0.6);
  filter: brightness(1.1);
}

/* Pagination */
.pagination {
  margin-top: 40px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.page-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled),
.page-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer & Dev Modal */
footer {
  margin-top: 60px;
  padding-bottom: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.dev-link {
  color: var(--accent-secondary);
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dev-link:hover {
  text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #111;
  border: 1px solid var(--glass-border);
  margin: 2% auto;
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 0 50px rgba(233, 109, 119, 0.2);
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 32px;
  color: white;
  cursor: pointer;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-modal:hover {
  background: var(--accent-primary);
  transform: rotate(90deg);
}

.glow-text-small {
  font-size: 2rem;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.stat-item span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-secondary);
  display: block;
}

.stat-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.contact-details {
  margin: 25px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 15px;
  border: 1px solid var(--glass-border);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact-item svg {
  color: var(--accent-secondary);
}

/* Game Detail Modal specific */
.detail-content {
  width: 1000px;
  max-width: 95vw;
  min-height: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 0;
  background: #0d0d0d;
}

.detail-header {
  position: relative;
  height: 400px;
  width: 100%;
}

.detail-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, #0d0d0d 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 30px;
  padding: 0 40px 40px 40px;
  margin-top: 50px;
}

.main-info p {
  text-align: justify;
}

.main-info p {
  text-align: justify;
  line-height: 1.6;
  color: var(--text-secondary);
}

.main-info h3,
.sidebar-info h3 {
  color: var(--accent-primary);
  margin-bottom: 15px;
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.requirements-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 25px;
  border-radius: 20px;
  height: fit-content;
}

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

.req-item {
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.req-item b {
  color: var(--accent-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Screenshots Gallery */
.screenshots-container {
  margin-top: 40px;
}

.screenshots-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.screenshots-row img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  cursor: zoom-in;
  transition: all 0.3s ease;
  border: 1px solid var(--glass-border);
}

.screenshots-row img:hover {
  border-color: var(--accent-primary);
  filter: brightness(1.1);
}

.metadata-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-row b {
  color: var(--text-primary);
}

.loading-detail {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  background: #0d0d0d;
  width: 100%;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  border-right-color: var(--accent-secondary);
  animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  margin-bottom: 25px;
  box-shadow: 0 0 20px rgba(233, 109, 119, 0.2);
}

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

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .detail-info-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .detail-header {
    height: 250px;
  }
}

.viewer-modal {
  z-index: 2000;
  background: black;
}

.viewer-content {
  width: 100vw;
  height: 100vh;
  max-width: 100% !important;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
}

#fullSizeImage {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.image-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.image-nav-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-50%) scale(1.1);
}

.image-nav-btn.prev {
  left: 30px;
}

.image-nav-btn.next {
  right: 30px;
}

.image-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.image-nav-btn:disabled:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.favorite-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 8px 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  color: var(--text-secondary);
  font-weight: 500;
}

.favorite-toggle:has(input:checked) {
  border-color: var(--accent-primary);
  background: rgba(233, 109, 119, 0.1);
  color: var(--accent-primary);
}

.favorite-toggle input {
  display: none;
}

/* Favorite & Share on Cards */
.card-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
  z-index: 5;
}

.icon-btn {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  transform: scale(1.1);
  background: var(--accent-primary);
}

.icon-btn.fav-active {
  color: var(--accent-primary);
  background: rgba(233, 109, 119, 0.2);
  border-color: var(--accent-primary);
}

.share-menu {
  position: absolute;
  top: 45px;
  right: 0;
  background: #111;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 120px;
}

.share-menu.show {
  display: flex;
}

.share-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.share-link:hover {
  background: var(--glass-bg);
  color: white;
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.notification-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notification-toast svg {
  flex-shrink: 0;
  stroke: #10b981;
}

/* User Data Modal */
.user-data-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-group input {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
}

.form-group input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(233, 109, 119, 0.2);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.form-actions .btn {
  flex: 1;
}

/* Home Button */
.home-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(233, 109, 119, 0.5);
  transition: all 0.3s ease;
  z-index: 100;
  border: none;
}

.home-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 25px rgba(233, 109, 119, 0.7);
}

@media (max-width: 768px) {

  .search-filter-bar {
    flex-direction: column;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .item {
    flex-direction: column;
  }

  /* Fix list view on mobile */
  .list-view .item {
    flex-direction: column;
  }

  .list-view .img-container {
    width: 100%;
    height: 200px;
  }

  .img-container {
    width: 100%;
    height: 200px;
  }

  .glow-text {
    font-size: 2.5rem;
  }

  .controls-bar {
    flex-direction: column;
    gap: 20px;
  }

  /* Fix grid view on mobile */
  .grid-view {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: 280px;
  }

  .action {
    min-width: unset;
    width: 100%;
  }
}

/* Advertisements */
.ad-container {
  margin: 20px auto;
  text-align: center;
  max-width: 1000px;
  width: 100%;
  display: none;
  /* Hidden until content is loaded */
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
}

.ad-container.show {
  display: block;
}

.ad-container img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.ad-between-games-slot {
  margin: 32px 0;
  grid-column: 1 / -1;
  width: 100%;
}

.ad-sidebar-slot {
  margin: 25px 0;
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
}