/* Reset and base styles */
.ad-img-small {
  max-width: 180px;
  max-height: 90px;
  border-radius: 8px;
  box-shadow: 0 2px 8px #000a;
}

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

.palestine {
  background-color: black;
  color: white;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  color: #333;
}

/* Container for consistent padding and max-width */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 20px;
  color: #2c3e50;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-top: 30px;
}

h2 {
  font-size: 2rem;
  padding: 15px 0;
  border-bottom: 2px solid #e0e0e0;
}
h3 {
  font-size: 2rem;
  padding: 15px 0;
}

p {
  margin-bottom: 15px;
}

a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

h6 {
  color: white;
}

/* Navigation */
.topnav {
  display: flex;
  justify-content: center;
  background-color: #2c3e50;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.topnav a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.topnav a:hover {
  background-color: #34495e;
  color: white;
  text-decoration: none;
}

.topnav a.active {
  background-color: #3498db;
  color: white;
}

/* Hero section */
.hero {
  background: linear-gradient(to right, #b51313, #2c3e50);
  color: white;
  padding: 60px 20px;
  text-align: center;
  margin-bottom: 30px;
}

.hero h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 30px;
}

.btn {
  display: inline-block;
  background-color: #e74c3c;
  color: white;
  padding: 12px 24px;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background-color: #c0392b;
  text-decoration: none;
  color: white;
}

/* Games grid */
.games-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.game-item {
  text-align: center;
  display: inline-block;
  margin: 10px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 150px;
  position: relative;
  perspective: 1000px;
}

.game-item:hover,
.game-item:focus-within {
  transform: translateY(-8px);
  z-index: 5;
}

.game-item button {
  width: 100%;
  height: 100px;
  border: none;
  border-radius: 10px;
  background-color: white;
  cursor: pointer;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.game-item button:hover,
.game-item button:focus {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transform: translateZ(10px) rotateX(5deg);
  background-color: #f8f9fa;
  outline: none;
}

.game-item button:focus {
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
  border: 2px solid rgba(52, 152, 219, 0.6);
}

.game-item button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.1s ease;
}

.game-item button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.game-item button:hover::after,
.game-item button:focus::after {
  opacity: 1;
  transform: scale(2);
}

.game-item img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  transition: transform 0.3s ease;
  z-index: 2;
  position: relative;
}

.game-item:hover img,
.game-item:focus-within img {
  transform: scale(1.1);
}

.game-item p {
  margin-top: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

/* --- RED HOVER FOR GAME BUTTON TEXT --- */
.game-item:hover p,
.game-item:focus-within p {
  color: #e74c3c;
  transform: scale(1.05);
}

.game-item:hover p::after,
.game-item:focus-within p::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #e74c3c;
  bottom: -3px;
  left: 0;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
  animation: underlineAnimation 0.3s forwards;
}

@keyframes underlineAnimation {
  to {
    transform: scaleX(1);
    transform-origin: bottom left;
  }
}

/* Marquee styling */
.marquee-container {
  background-color: #f8f9fa;
  padding: 10px;
  margin: 20px 0;
  border-radius: 5px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

marquee {
  padding: 5px 0;
}

marquee img {
  margin: 0 10px;
  vertical-align: middle;
}

/* Footer */
footer {
  background-color: #2c3e50;
  color: white;
  padding: 30px 0;
  margin-top: 50px;
  text-align: center;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
}

.footer-links a {
  color: white;
  margin: 0 15px;
}

.copyright {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #bdc3c7;
}

/* Credits page */
.credits-section {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.credits-section h2 {
  color: #3498db;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.credits-list {
  list-style-type: none;
}

.credits-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

/* Open Source page */
.license-section {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.license-section h2 {
  color: #3498db;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.license-section pre {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 15px 0;
}

.cta-section {
  text-align: center;
  margin: 40px 0;
}

/* Responsive styles */
@media (max-width: 768px) {
  .topnav {
    flex-direction: column;
  }

  .topnav a {
    width: 100%;
    padding: 12px;
  }

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

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

  .game-item {
    width: 130px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .hero {
    padding: 30px 15px;
  }

  .game-item {
    width: 110px;
  }

  .game-item button {
    height: 80px;
  }

  .game-item img {
    max-width: 60px;
    max-height: 60px;
  }

  .footer-links a {
    margin: 5px 10px;
  }
}
/* ...existing code... */

/* Dark Theme Support */
body.dark-theme,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme p,
body.dark-theme li,
body.dark-theme span,
body.dark-theme label,
body.dark-theme a,
body.dark-theme th,
body.dark-theme td,
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
  color: #fff !important;
}

/* Strong dark theme override for all backgrounds */
body.dark-theme,
body.dark-theme .container,
body.dark-theme .credits-section,
body.dark-theme .license-section,
body.dark-theme .archive-section,
body.dark-theme .footer-content,
body.dark-theme footer,
body.dark-theme .marquee-container,
body.dark-theme .topnav,
body.dark-theme .hero,
body.dark-theme .archive-item {
  background: #181a1b !important;
  color: #fff !important;
}


body.dark-theme .hero {
  background: linear-gradient(to right, #b51313, #2c3e50) !important;
  color: #fff !important;
}

