/* ===== Main Style ===== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #121212;
  color: #fff;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* Light Theme */
body.light-theme {
  background: #f5f5f5;
  color: #121212;
}

/* Header */
header {
  background: #1f1f1f;
  padding: 15px;
  text-align: center;
  transition: background 0.3s;
}
body.light-theme header {
  background: #e0e0e0;
}
header h1 {
  color: #ff4757;
  margin: 0;
}

/* Navigation */
nav {
  background: #2b2b2b;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  transition: background 0.3s;
}
body.light-theme nav {
  background: #dcdcdc;
}
nav a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  transition: color 0.3s;
}
body.light-theme nav a {
  color: #121212;
}
nav a:hover {
  color: #ff4757;
}
nav a.active {
  color: #ff4757;
  border-bottom: 2px solid #ff4757;
}

/* ===== Theme Switch ===== */
.theme-switch {
  position: fixed;
  top: 15px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 20px;
  user-select: none;
  z-index: 1000;
}
.theme-switch input {
  display: none;
}
.theme-switch label {
  display: block;
  width: 50px;
  height: 25px;
  background: #555;
  border-radius: 50px;
  position: relative;
  transition: background 0.3s;
  cursor: pointer;
}
.theme-switch label::after {
  content: "";
  width: 23px;
  height: 23px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 1px;
  left: 1px;
  transition: transform 0.3s;
}
.theme-switch input:checked + label::after {
  transform: translateX(25px);
}
.theme-switch .sun,
.theme-switch .moon {
  font-size: 18px;
}

/* ===== Container ===== */
.container {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Article */
.article img {
  max-width: 100%;
  border-radius: 10px;
  transition: transform 0.3s;
}
.article img:hover {
  transform: scale(1.05);
}
.article h1 {
  color: #ff4757;
  margin-bottom: 10px;
}
body.light-theme .article h1 {
  color: #d91e18;
}
.article p {
  margin-bottom: 15px;
}
.author {
  font-style: italic;
  color: #ffa502;
  margin-bottom: 15px;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #ff4757;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.back-to-top:hover {
  opacity: 1;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 15px;
  background: #1f1f1f;
  margin-top: 30px;
  transition: background 0.3s, color 0.3s;
}
body.light-theme footer {
  background: #e0e0e0;
  color: #121212;
}

/* ===== Floating Share Button ===== */
.share-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 9999;
}
.share-btn {
  background: #ff4757;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.3s, opacity 0.3s;
  opacity: 0.7;
}
.share-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  opacity: 1;
}
.social-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.social-btns.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.social-btns a {
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.3s;
}
.social-btns a.whatsapp {
  background: #25D366;
}
.social-btns a.facebook {
  background: #1877F2;
}
.social-btns a:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ===== Responsive Fixes ===== */
@media screen and (max-width: 600px) {
  /* Share button smaller */
  .share-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* Theme switch smaller */
  .theme-switch {
    top: 10px;
    right: 10px;
    transform: scale(0.85);
    font-size: 16px;
  }
  .sun,
  .moon {
    font-size: 15px;
  }
}

/* popup */
.popup {
  position: absolute;
  background: #222;
  color: #fff;
  border: 1px solid #ff4757;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  width: 250px;
  z-index: 100;
}
.hidden { display: none; }
#gameList li { position: relative; cursor: pointer; }

.popup {
  position: absolute;
  background: #222;
  color: #fff;
  border: 1px solid #ff4757;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  width: 90%;   /* ✅ use screen width on mobile */
  max-width: 250px;
  z-index: 100;
  top: 100%;
  left: 0;
}
