/* -------------------------------------------------- */
/* 🎮 GLOBAL RESET + BASE LAYOUT                      */
/* -------------------------------------------------- */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: auto;          /* allow page to grow vertically */
  overflow-x: hidden;    /* prevent sideways scrolling */
  overflow-y: auto;      /* allow vertical scrolling */
  background: #000;
  font-family: Arial, sans-serif;
  color: #fff;
}

/* Center all game content */
.game-container {
  width: 100%;
  max-width: 480px;        /* Ideal mobile width */
  margin: 0 auto;
  height: auto;
  transform-origin: top center;
  text-align: center;
}

/* Titles */
h1 {
  margin-top: 10px;
  font-size: 32px;
}

.subtitle {
  margin-top: -10px;
  margin-bottom: 10px;
  font-size: 16px;
  opacity: 0.8;
}

/* Buttons */
button {
  padding: 10px 20px;
  font-size: 18px;
  border: 2px solid #00ffff;
  background: rgba(0, 0, 0, 0.4);
  color: #00ffff;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background: rgba(0, 255, 255, 0.2);
}

/* HUD text */
.hud p {
  margin: 5px 0;
  font-size: 20px;
}

/* -------------------------------------------------- */
/* 📱 RESPONSIVE AUTO-SCALING                         */
/* -------------------------------------------------- */

/* Large phones / small tablets */
@media (max-height: 900px) {
  .game-container {
    transform: scale(0.9);
  }
}

/* Standard phones */
@media (max-height: 750px) {
  .game-container {
    transform: scale(0.8);
  }
}

/* Small phones */
@media (max-height: 650px) {
  .game-container {
    transform: scale(0.7);
  }
}

/* Very small screens */
@media (max-height: 550px) {
  .game-container {
    transform: scale(0.6);
  }
}

/* -------------------------------------------------- */
/* 🔄 PORTRAIT ORIENTATION LOCK                       */
/* -------------------------------------------------- */

#rotate-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-size: 24px;
  text-align: center;
  padding-top: 40%;
  z-index: 9999;
}

/* -------------------------------------------------- */
/* 🌌 SPACE DODGE GAME ELEMENTS                       */
/* -------------------------------------------------- */

/* Game area */
#dodge-area {
  position: relative;
  width: 100%;
  height: 500px;
  background: radial-gradient(circle at top, #222 0, #000 60%);
  border: 2px solid #ff00ff;
  overflow: hidden;
  margin-top: 20px;
}

/* Player */
#player {
  position: absolute;
  bottom: 10px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* Character select */
#character-select {
  margin-top: 20px;
  padding: 15px;
  border: 2px solid #00ffff;
  background: rgba(0, 0, 0, 0.5);
}

.character-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.character-option {
  width: 60px;
  height: 60px;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.character-option.selected {
  border-color: #00ffff;
  box-shadow: 0 0 10px #00ffff;
  transform: scale(1.1);
}

/* Falling hazards */
.falling {
  position: absolute;
  top: -60px;
}

/* Asteroid */
.asteroid {
  width: 45px;
  height: 45px;
  background: #555;
  border-radius: 50%;
  box-shadow: inset -5px -5px 10px #222;
}

/* Comet */
.comet {
  width: 20px;
  height: 20px;
  background: #ffcc00;
  border-radius: 50%;
  box-shadow: 0 0 15px #ffcc00;
}

.comet::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 8px;
  background: linear-gradient(to left, rgba(255, 204, 0, 0.8), transparent);
  top: 6px;
  left: -40px;
}

/* UFO */
.ufo {
  width: 50px;
  height: 20px;
  background: #66ffcc;
  border-radius: 50%;
  box-shadow: 0 0 10px #66ffcc;
  position: relative;
}

.ufo::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 15px;
  background: #99ffff;
  border-radius: 50%;
  top: -10px;
  left: 10px;
}

/* Meteor */
.meteor {
  width: 18px;
  height: 35px;
  background: #ff3300;
  border-radius: 50%;
  box-shadow: 0 0 12px #ff3300;
}

/* Satellite */
.satellite {
  width: 40px;
  height: 20px;
  background: #cccccc;
  position: relative;
}

.satellite::before,
.satellite::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 20px;
  background: #888;
  top: 0;
}

.satellite::before {
  left: -12px;
}

.satellite::after {
  right: -12px;
}

/* -------------------------------------------------- */
/* 🎮 ARCADE CABINET UI                               */
/* -------------------------------------------------- */

.arcade-cabinet {
  width: 100%;
  max-width: 480px;
  margin: 20px auto;
  background: #111;
  border: 8px solid #222;
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 0 40px #000 inset, 0 0 20px #000;
}

/* Marquee */
.marquee {
  background: linear-gradient(to bottom, #ff0040, #800020);
  padding: 15px;
  text-align: center;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 0 10px #ff0040;
}

.marquee span {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 8px #fff;
}

/* Screen */
.screen {
  background: radial-gradient(circle at center, #222 0%, #000 80%);
  border: 4px solid #444;
  border-radius: 10px;
  padding: 20px;
  height: 400px;
  overflow-y: auto;
  box-shadow: 0 0 20px #00ffff inset;
}

.screen h2 {
  margin-top: 0;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

/* Game list */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-link {
  display: block;
  padding: 15px;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #00ffff;
  border-radius: 10px;
  color: #00ffff;
  text-decoration: none;
  font-size: 20px;
  text-align: center;
  transition: 0.2s;
}

.game-link:hover {
  background: rgba(0, 255, 255, 0.3);
  transform: scale(1.05);
}

.game-link p {
  margin: 5px 0 0;
  font-size: 14px;
  color: #fff;
}

/* Controls */
.controls {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Joystick */
.stick {
  width: 40px;
  height: 40px;
  background: #900;
  border-radius: 50%;
  border: 4px solid #600;
  box-shadow: 0 0 10px #f00;
}

/* Buttons */
.buttons {
  display: flex;
  gap: 10px;
}

.btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 3px solid #333;
  box-shadow: 0 0 10px #000 inset;
}

.btn.red { background: #ff0033; }
.btn.blue { background: #0099ff; }
.btn.yellow { background: #ffcc00; }
/* INSERT COIN animation */
.insert-coin {
  margin-top: 10px;
  font-size: 20px;
  font-weight: bold;
  color: #ffcc00;
  text-shadow: 0 0 6px #ffcc00, 0 0 12px #ff6600;
  animation: coin-blink 1s infinite;
  letter-spacing: 2px;
}

@keyframes coin-blink {
  0%, 50% {
    opacity: 1;
    transform: scale(1);
  }
  51%, 100% {
    opacity: 0.2;
    transform: scale(1.05);
  }
}

/* Pixel-art CRT border */
.screen {
  position: relative;
  border: 4px solid #444;
  border-radius: 4px;
  padding: 20px;
  background: radial-gradient(circle at center, #222 0%, #000 80%);
  box-shadow:
    0 0 20px #00ffff inset,
    0 0 10px #003333 inset,
    0 0 15px #000;
}

/* Pixel corners */
.screen::before,
.screen::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #00ffff;
  box-shadow:
    0 0 6px #00ffff,
    0 0 12px #00ffff;
}

.screen::before {
  top: -6px;
  left: -6px;
}

.screen::after {
  top: -6px;
  right: -6px;
}

.screen .corner-bl {
  position: absolute;
  bottom: -6px;
  left: -6px;
  width: 12px;
  height: 12px;
  background: #00ffff;
  box-shadow:
    0 0 6px #00ffff,
    0 0 12px #00ffff;
}

.screen .corner-br {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: #00ffff;
  box-shadow:
    0 0 6px #00ffff,
    0 0 12px #00ffff;
}

/* -------------------------------------------------- */
/* 🖥️ ARCADE BOOT SCREEN ANIMATION                    */
/* -------------------------------------------------- */

#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: boot-fadeout 3.5s forwards;
}

.boot-text {
  font-family: "Courier New", monospace;
  color: #00ff66;
  font-size: 18px;
  text-align: left;
  line-height: 1.4;
  opacity: 0;
  animation: boot-flicker 1.5s forwards;
}

.boot-text p {
  margin: 5px 0;
}

.boot-ok {
  color: #00ffcc;
  text-shadow: 0 0 8px #00ffff;
  animation: boot-ok-blink 1s infinite alternate;
}

/* Flicker in */
@keyframes boot-flicker {
  0% { opacity: 0; }
  20% { opacity: 1; }
  25% { opacity: 0.3; }
  30% { opacity: 1; }
  40% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 1; }
}

/* SYSTEM ONLINE blink */
@keyframes boot-ok-blink {
  0% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* Fade out entire boot screen */
@keyframes boot-fadeout {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

