/* === GLOBAL === */
body {
  margin: 0;
  background: radial-gradient(circle at 50% 20%, #111 0%, #000 100%);
  color: white;
  font-family: 'Press Start 2P', cursive;
  text-align: center;
  overflow-x: hidden;
}

/* === BACKGROUND === */
#background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.layer {
  position: absolute;
  left: 0;
  width: 100%;
  height: auto;
}
.sky {
  top: 0;
  height: 100%;
  object-fit: cover;
}
.forest {
  bottom: 0;
  width: 100%;
  height: auto;
}

/* === STARS (Light & Optimized) === */
#stars {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0.6;
  animation: twinkle 3.4s infinite alternate;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 3px #fff);
}
@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.4); }
}

/* === HEADER MENU === */
.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: 12px 24px;
  background: rgba(0, 0, 20, 0.24);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  will-change: backdrop-filter;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 102, 0, 0.5);
  box-shadow:
    0 0 10px rgba(255, 153, 51, 0.6),
    0 0 20px rgba(255, 102, 0, 0.4);
  box-sizing: border-box;
}

/* === LOGO === */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 10px;
}
.logo-img {
  width: clamp(42px, 5vw, 56px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 0 6px #ff9933);
  transition: transform 0.3s ease, filter 0.3s ease;
}
.logo-img:hover {
  transform: rotate(6deg) scale(1.07);
  filter: drop-shadow(0 0 10px #00ffee);
}

/* === NAVIGATION MENU === */
.main-nav {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
  padding-right: 30px;
  box-sizing: border-box;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1px;
  transition: color 0.3s, text-shadow 0.3s;
  white-space: nowrap;
}
.main-nav a:hover {
  color: #ff9933;
  text-shadow: 0 0 8px #ff9933, 0 0 16px #00ffee;
}

/* === BUY PIXIE === */
.main-nav a.buy-link {
  color: #ffcc00;
  font-weight: bold;
  border: 1px solid #ffcc00;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.3s ease;
}
.main-nav a.buy-link:hover {
  background: #ffcc00;
  color: #000;
  text-shadow: none;
  box-shadow: 0 0 8px #ffcc00, 0 0 15px #ffaa00;
}

/* === HAMBURGER MENU (MOBILE) === */
.menu-toggle {
  display: none;
  font-size: 22px;
  color: #ff9933;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 12px;
  text-shadow: 0 0 6px #ff6600, 0 0 12px #ff3300;
}

/* === MOBILE MENU === */
@media (max-width: 768px) {
  .site-header {
    justify-content: space-between;
    padding: 10px 16px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 55px;
    left: 8px;
    right: 8px;
    background: rgba(30, 0, 0, 0.92);
    border: 1px solid rgba(255, 153, 51, 0.4);
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.6);
    border-radius: 6px;
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.35s ease;
    text-align: center;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 15px 0;
    width: 100%;
  }

  .main-nav a {
    display: inline-block;
    font-size: 14px;
    padding: 8px 0;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255,255,255,0.4);
  }

  .main-nav a:hover {
    color: #ff9933;
    text-shadow: 0 0 8px #ff6600, 0 0 15px #ff3300;
  }

  .menu-toggle { display: block; }

  .main-nav.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: neonFade 0.4s ease-out;
  }

  @keyframes neonFade {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* === CONTENT === */
.content {
  margin-top: 120px;
  position: relative;
  z-index: 2;
}
@media (max-width: 768px) {
  .content { margin-top: 90px; }
}

/* === TITLE === */
.title {
  font-size: 56px;
  color: #ffcc66;
  text-shadow: 0 0 10px #ff6600, 0 0 20px #ff9933, 0 0 40px #ff3300;
  animation: flicker 1.8s infinite alternate;
  margin-bottom: 15px;
}
@keyframes flicker {
  from { opacity: 1; }
  50% { opacity: 0.9; text-shadow: 0 0 15px #ff9933, 0 0 30px #ff6600; }
  to { opacity: 1; text-shadow: 0 0 20px #ff3300, 0 0 40px #ff6600; }
}
@media (max-width: 768px) {
  .title { font-size: 32px; line-height: 1.2; padding: 0 10px; }
}
@media (max-width: 480px) {
  .title { font-size: 26px; }
}

/* === DESCRIPTION === */
.desc {
  max-width: 600px;
  margin: 0 auto 20px auto;
  padding: 0 15px;
  line-height: 1.6;
  font-size: 16px;
  color: #ddd;
}
.desc a {
  color: #ff9933;
  text-decoration: none;
}
.desc a:hover {
  text-shadow: 0 0 10px #ff99ff;
}
@media (max-width: 768px) {
  .desc {
    font-size: 12px;
    padding: 0 20px;
    line-height: 1.5;
  }
}

/* === GAME CONTAINER === */
.game-container {
  position: relative;
  width: 800px;
  max-width: 90%;
  aspect-ratio: 16 / 9;
  background-color: #111;
  border: 3px solid #ff6600;
  border-radius: 10px;
  margin: 0 auto;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 0 20px rgba(255,102,0,0.8);
}
.game-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .game-container {
    width: 100%;
    border: 2px solid #ff6600;
    border-radius: 5px;
  }
}

/* === FULLSCREEN BUTTON === */
.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #333;
  color: white;
  padding: 8px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 3;
  font-size: 16px;
}
.fullscreen-btn:hover { background-color: #555; }

/* === FULLSCREEN MODE === */
.fullscreen-mode {
  display: flex;
  justify-content: center;
  align-items: center;
  background: black;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
}
.fullscreen-mode iframe {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 1280px;
  height: auto;
  max-height: 720px;
  margin: auto;
  display: block;
}

/* === FULLSCREEN MODE (mobile override) === */
@media (max-width: 768px) {
  .fullscreen-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
  }
  .fullscreen-mode iframe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vw * 9 / 16);
    max-height: 100vh;
    max-width: 100vw;
    margin: auto;
    border: none;
    background: black;
  }
  @media (orientation: portrait) {
    .fullscreen-mode iframe {
      height: 100vh;
      width: calc(100vh * 16 / 9);
      max-width: 100vw;
      max-height: 100vh;
    }
  }
}

/* === PLAY BUTTON === */
.play-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  margin-bottom: 40px;
  z-index: 2;
  position: relative;
}
.play-btn {
  background: linear-gradient(#ff9933, #ff6600);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 18px;
  font-weight: bold;
  padding: 10px 25px;
  cursor: pointer;
  box-shadow: 0 4px #cc5200, 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px #b34700, 0 5px 10px rgba(0, 0, 0, 0.3);
}
.play-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px #994d00, 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* === LEADERBOARD === */
h2 {
  color: #ff9933;
  text-shadow: 0 0 10px #ff6600, 0 0 20px #ff3300;
  margin-bottom: 10px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}
#leaderboard {
  margin: 30px auto;
  max-width: 95%;
  overflow-x: auto;
  position: relative;
  z-index: 2;
}
#leaderboard table {
  border-collapse: collapse;
  margin: 0 auto;
  color: #fff;
  border: 2px solid #ff6600;
  box-shadow:
    0 0 15px #ff6600,
    0 0 25px #ff9933 inset,
    0 0 40px rgba(255, 102, 0, 0.6);
  background: rgba(0, 0, 0, 0.6);
  table-layout: fixed;
  width: 100%;
}
#leaderboard th,
#leaderboard td {
  border: 1px solid #ff9933;
  padding: 6px 8px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 6px #ff6600, 0 0 12px #ff9933;
}
#leaderboard th:nth-child(1),
#leaderboard td:nth-child(1) { width: 15%; }
#leaderboard th:nth-child(2),
#leaderboard td:nth-child(2) { width: 45%; }
#leaderboard th:nth-child(3),
#leaderboard td:nth-child(3) { width: 40%; }
@media (max-width: 768px) {
  #leaderboard th, #leaderboard td {
    font-size: 10px;
    padding: 4px 6px;
  }
  h2 { font-size: 16px; }
}

/* === MODAL === */
#usernameModal {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
}
#usernameModal .modal-box {
  background: #222;
  padding: 20px;
  border: 2px solid white;
  text-align: center;
}
#usernameModal input {
  margin-bottom: 10px;
  padding: 6px;
  font-family: 'Press Start 2P', cursive;
}

/* === LOADING SCREEN === */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #000 0%, #070707 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 99999;
  transition: opacity 0.8s ease;
}
#loadingScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  position: relative;
}

.loader-center {
  position: relative;
  display: inline-block;
}

.loader-logo {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 8px #ffcc66);
}

/* === LOADING TITLE === */
.loader-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 20px;
  color: #ff9933; /* 🟧 Oranye neon */
  margin-top: 18px;
  text-shadow:
    0 0 10px #ff6600,
    0 0 20px #ff9933,
    0 0 40px #ff3300;
  animation: flicker 1.6s infinite alternate;
}

/* === LOADING BAR === */
.loader-bar {
  position: relative;
  width: 200px;
  height: 10px;
  background: rgba(255, 153, 51, 0.1);
  border: 2px solid #ff9933;
  border-radius: 10px;
  margin: 25px auto 0;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 153, 51, 0.4);
}

.loader-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffcc33, #ff6600);
  border-radius: 10px;
  box-shadow: 0 0 15px #ff9933;
  animation: fillLoader 2.8s ease-in-out infinite alternate;
}

@keyframes fillLoader {
  0% { width: 10%; opacity: 0.7; }
  50% { width: 80%; opacity: 1; }
  100% { width: 100%; opacity: 0.8; }
}

/* === PIXIE DUST SPARKLES (pas di logo) === */
.sparkle-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;      /* orbit lebih besar */
  height: 160px;
  pointer-events: none;
  z-index: 6;
}

.sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff, rgba(255,255,255,0));
  border-radius: 50%;
  opacity: 0.85;
  transform-origin: center;
  animation: sparkleOrbit 3.6s linear infinite;
  filter: drop-shadow(0 0 8px #ffcc66);
}

@keyframes sparkleOrbit {
  0%   { transform: rotate(0deg) translateX(70px) rotate(0deg); opacity: 0.7; }
  50%  { transform: rotate(180deg) translateX(70px) rotate(-180deg); opacity: 1; }
  100% { transform: rotate(360deg) translateX(70px) rotate(-360deg); opacity: 0.7; }
}

/* === DISCLAIMER FOOTER === */
.disclaimer {
  margin-top: 60px;
  padding: 40px 20px 60px;
  text-align: center;
  color: #ffcc99;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 153, 51, 0.4);
  box-shadow: 0 0 15px rgba(255, 102, 0, 0.4) inset;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  line-height: 1.8;
  text-shadow: 0 0 6px #ff6600, 0 0 12px #ff9933;
  position: relative;
  z-index: 2;
}

.disclaimer h3 {
  font-size: 14px;
  color: #ff9933;
  text-shadow: 0 0 10px #ff6600, 0 0 20px #ff3300;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .disclaimer {
    font-size: 8px;
    line-height: 1.5;
    padding: 30px 15px 50px;
  }

  .disclaimer h3 {
    font-size: 12px;
  }
}



