/* Reset and base styling */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background: #111;
  color: #fff;
}

/* Top Games Slider */
.total-games-slider-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 20px;
  background: #181818;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #00ff99 transparent;
}

.total-games-slider {
  display: flex;
  gap: 15px;
}

.total-game-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s;
}

.total-game-item:hover {
  transform: scale(1.1);
}

.total-game-item img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #444;
  flex-shrink: 0;
}

.total-game-item .game-title {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
}

/* Main content layout */
.main-content {
  display: flex;
  padding: 20px 40px;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.left-section {
  flex: 2 1 0;
  min-width: 0;
}

.right-section {
  flex: 1 1 280px;
  min-width: 280px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Game preview and iframe */
.game-preview-container {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 255, 153, 0.5);
  background: #000;
}

.game-cover {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
}

.game-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  transition: transform 0.3s;
}

.game-cover:hover img {
  transform: scale(1.05);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.play-button:hover {
  background: rgba(0, 204, 136, 0.8);
}

.gameplay-iframe {
  width: 100%;
  height: 600px;
  border: none;
  margin-top: 20px;
  border-radius: 10px;
  background: #000;
  display: none;
}

.fullscreen-btn {
  margin-top: 12px;
  padding: 12px 25px;
  background: #00cc88;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
  width: fit-content;
}

.fullscreen-btn:hover {
  background: #00aa77;
}

/* Screenshots */
.screenshots {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 25px 0;
  justify-content: flex-start;
}

.screenshots img {
  width: calc(33.333% - 8px);
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  transition: transform 0.3s;
  aspect-ratio: 16 / 9;
}

.screenshots img:hover {
  transform: scale(1.05);
}

/* Game description */
.game-description {
  margin-top: 20px;
}

/*.game-description h2 {*/
/*  font-size: 28px;*/
/*  margin-bottom: 14px;*/
  /*color: #00ff99;*/
/*  word-break: break-word;*/
/*}*/

.game-description p {
  line-height: 1.6;
  color: #ccc;
  white-space: pre-line;
}

/* Right section */
.ad-box {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  color: #888;
  font-size: 16px;
  user-select: none;
  min-height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags span {
  display: inline-block;
  background: #00cc88;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
  user-select: none;
  transition: background 0.3s;
}

.tags span:hover {
  background: #00aa77;
}

/* Related games slider */
.related-games {
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto 50px auto;
}

.related-games h3 {
  margin-bottom: 15px;
  font-size: 22px;
  color: #00ff99;
}

.related-slider {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #00ff99 transparent;
}

.related-slider a {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s;
}

.related-slider a:hover {
  transform: scale(1.1);
}

.related-slider img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #444;
}

.related-slider div {
  font-size: 12px;
  margin-top: 6px;
  word-break: break-word;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
}

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  padding: 10px;
  box-sizing: border-box;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  object-fit: contain;
  user-select: none;
}

/* Scrollbar styling for WebKit */
.total-games-slider-wrapper::-webkit-scrollbar,
.related-slider::-webkit-scrollbar {
  height: 8px;
}

.total-games-slider-wrapper::-webkit-scrollbar-thumb,
.related-slider::-webkit-scrollbar-thumb {
  background-color: #00ff99;
  border-radius: 4px;
}

.total-games-slider-wrapper::-webkit-scrollbar-track,
.related-slider::-webkit-scrollbar-track {
  background: transparent;
}

/* Media Queries */

/* Large tablets and small desktops */
@media (max-width: 992px) {
  .main-content {
    flex-direction: column;
    padding: 20px;
  }
  .left-section, .right-section {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: auto;
  }
  .right-section {
    margin-top: 30px;
    max-width: none;
  }
  .gameplay-iframe {
    height: 450px;
  }
  .screenshots img {
    width: calc(50% - 10px);
  }
}

/* Tablets and large phones */
@media (max-width: 768px) {
  .total-game-item img {
    width: 75px;
    height: 75px;
  }
  .total-game-item {
    width: 75px;
  }
  .related-slider a {
    width: 85px;
  }
  .related-slider img {
    width: 85px;
    height: 85px;
  }
}

/* Small phones */
@media (max-width: 576px) {
  .total-games-slider-wrapper {
    padding: 5px 10px;
  }
  .total-game-item {
    width: 65px;
  }
  .total-game-item img {
    width: 65px;
    height: 65px;
  }
  .screenshots img {
    width: 100%;
  }
  .gameplay-iframe {
    height: 300px;
  }
  .fullscreen-btn {
    width: 100%;
  }
  .main-content {
    padding: 10px 15px;
    gap: 20px;
  }
  .right-section {
    max-width: 100%;
  }
}

/* Accessibility: Focus states */
a:focus, button:focus {
  outline: 2px solid #00ff99;
  outline-offset: 2px;
}
