/* ====== General Reset ====== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  color: #333;
}

/* ====== Header ====== */
header {
  background: #000;
  color: #fff;
  padding: 15px 20px;
  flex-shrink: 0;
}

.header-container {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  max-height: 80px;
}

/* Navigation */
nav a {
  color: #fff;
  margin-left: 20px;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  color: #ff4444;
}

/* ====== Main Content ====== */
main {
  flex: 1 0 auto;
  padding: 20px;
  max-width: 1000px;
  margin: auto;
  overflow-y: auto;
}

/* ====== Games Section ====== */
.games {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.game-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  flex: 1 1 300px;
}

.game-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

/* ====== Slideshow ====== */
.slideshow {
  position: relative;
  margin: 10px 0;
  height: 180px;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

.slideshow img.active {
  display: block;
  animation: fade 1s ease-in-out;
}

@keyframes fade {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* ====== Buttons ====== */
.game-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 15px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.3s;
}

.game-btn:hover {
  background: #ff4444;
}

.game-btn.disabled {
  background: #555;
  cursor: not-allowed;
}

/* ====== Footer ====== */
footer {
  flex-shrink: 0;
  text-align: center;
  padding: 15px;
  background: #000;
  color: white;
}

/* ====== Popup Modal ====== */
.popup {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
}

.popup-content {
  max-width: 90%;
  max-height: 90%;
  text-align: center;
  color: #fff;
  border-radius: 8px;
  padding: 20px 10px 10px 10px;
  position: relative;
  /* overflow removed so arrows are visible */
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.popup-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.popup-title {
  font-size: 1.2rem;
  margin: 0;
}

.popup-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Fixed close button */
.popup-close {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 2.2rem;
  cursor: pointer;
  color: #fff;
  z-index: 1000;
}

.popup-close:hover { color: #ff4444; }

/* Popup navigation arrows */
.popup-prev, .popup-next {
  position: fixed; /* relative to screen to avoid clipping */
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  padding: 10px;
  z-index: 1001;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
}

.popup-prev { left: 20px; }
.popup-next { right: 20px; }

.popup-prev:hover, .popup-next:hover {
  background: rgba(255, 68, 68, 0.6);
}
