* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #050505;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 18px 10px;
  overflow-x: hidden;
  color: #ffffff;
  font-family: "Press Start 2P", monospace;
  background:
    radial-gradient(circle at top, rgba(0, 255, 102, 0.12), transparent 35%),
    linear-gradient(rgba(255, 255, 255, 0.03) 50%, rgba(0, 0, 0, 0.22) 50%),
    #070707;
  background-size: auto, 100% 4px, auto;
}

.hidden {
  display: none !important;
}

.arcade-cabinet {
  width: min(100%, 660px);
  margin: 0 auto;
  padding: 18px;
  border: 6px double #00ff66;
  border-radius: 18px;
  background: linear-gradient(145deg, #1a1a1a, #0b0b0b);
  box-shadow:
    0 0 24px rgba(0, 255, 102, 0.34),
    0 0 80px rgba(255, 0, 85, 0.08);
}

.arcade-header {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 4px dashed #00ff66;
}

#arcade-title {
  margin: 0;
  color: #00ff66;
  font-size: 16px;
  line-height: 1.5;
  text-shadow:
    0 0 8px rgba(0, 255, 102, 0.65),
    3px 3px #000;
}

#arcade-subtitle {
  margin: 12px 0 0;
  color: #ffcc00;
  font-size: 9px;
}

.score-board {
  margin: 14px 0 0;
  color: #ff0055;
  font-size: 11px;
}

.arcade-screen {
  min-height: 430px;
  max-height: 78vh;
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 5px solid #333;
  border-radius: 12px;
  background: #000;
  box-shadow: inset 0 0 30px rgba(0, 255, 102, 0.12);
}

.arcade-screen::-webkit-scrollbar {
  width: 8px;
}

.arcade-screen::-webkit-scrollbar-thumb {
  background: #00ff66;
}

.game-play-area {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  border: 4px solid #00ff66;
  background:
    linear-gradient(rgba(0, 255, 102, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 102, 0.06) 1px, transparent 1px),
    #020202;
  background-size: 22px 22px;
}

.catcher-char {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 20;
  transform: translateX(-50%);
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.85));
  user-select: none;
}

.falling-item {
  position: absolute;
  top: -90px;
  z-index: 10;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.falling-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter:
    drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(0 0 8px rgba(0, 255, 102, 0.35));
}

.falling-item.emoji-fallback {
  font-size: 42px;
}

.hp-area {
  margin-top: 18px;
  text-align: center;
}

.hp-label {
  margin: 0 0 8px;
  color: #ffcc00;
  font-size: 9px;
}

.hp-border {
  width: 100%;
  height: 24px;
  padding: 4px;
  border: 3px solid #ffffff;
  background: #111111;
}

.hp-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff0055, #ffcc00, #00ff66);
  transition: width 0.2s ease;
}

.hp-percent {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: 10px;
}

.game-hint {
  margin: 18px 0 0;
  color: #cfcfcf;
  font-family: "VT323", monospace;
  font-size: 22px;
  line-height: 1.25;
  text-align: center;
}

.game-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.pixel-btn,
.pixel-btn-sm {
  cursor: pointer;
  border: 3px solid #ffffff;
  color: #000000;
  font-family: "Press Start 2P", monospace;
  font-weight: 700;
  box-shadow: 4px 4px 0 #000000;
  transition: transform 0.1s ease;
}

.pixel-btn {
  padding: 14px 10px;
  font-size: 9px;
  line-height: 1.5;
}

.pixel-btn-sm {
  padding: 10px 12px;
  font-size: 8px;
}

.pixel-btn:active,
.pixel-btn-sm:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000000;
}

.btn-yellow {
  background: #ffcc00;
}

.btn-green {
  background: #00ff66;
}

.stage-clear-banner {
  padding: 14px 10px;
  margin-bottom: 22px;
  text-align: center;
  color: #ffcc00;
  font-size: 14px;
  line-height: 1.5;
  border: 4px solid #ffcc00;
  background: #180018;
  box-shadow: 0 0 18px rgba(255, 204, 0, 0.26);
}

.reward-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 4px dashed #333333;
}

.reward-block h2 {
  margin: 0 0 16px;
  color: #ff0055;
  font-size: 11px;
  line-height: 1.5;
}

.pixel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pixel-frame {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 3px dashed #00ff66;
  background: #050505;
  overflow: hidden;
}

.img-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(0, 255, 102, 0.08), transparent 60%),
    #000000;
}

.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 4px;
  background: #000000;
}

.img-slot span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7d7d7d;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.94);
  pointer-events: none;
}

.img-slot.has-image span {
  display: none !important;
}

.pixel-frame input {
  display: none;
}

body.admin-mode .pixel-frame {
  cursor: pointer;
}

.terminal-box {
  min-height: 170px;
  max-height: 290px;
  padding: 16px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #00ff66;
  font-family: "VT323", monospace;
  font-size: 24px;
  line-height: 1.18;
  border: 3px solid #00ff66;
  background: #030303;
}

.music-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-music-lbl {
  display: none;
  padding: 10px 12px;
  border: 3px solid #ffffff;
  color: #ffffff;
  background: #222222;
  font-size: 8px;
  box-shadow: 4px 4px 0 #000000;
  cursor: pointer;
}

#music-file {
  display: none;
}

body.admin-mode .upload-music-lbl {
  display: inline-block;
}

.coin-text {
  color: #ffcc00;
  font-size: 10px;
}

.gacha-display {
  min-height: 86px;
  padding: 16px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #ffffff;
  font-family: "VT323", monospace;
  font-size: 24px;
  line-height: 1.2;
  border: 3px solid #ffcc00;
  background: #120b00;
}

.gacha-btn {
  width: 100%;
  margin-top: 14px;
}

.inventory-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.inv-slot {
  min-height: 44px;
  padding: 10px;
  color: #a0a0a0;
  font-family: "VT323", monospace;
  font-size: 20px;
  line-height: 1.15;
  border: 2px solid #333333;
  background: #080808;
}

.inv-slot.claimed {
  color: #00ff66;
  border-color: #00ff66;
}

.final-btn {
  width: 100%;
  margin-top: 24px;
}

.retro-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.76);
}

.retro-modal-card {
  width: min(100%, 420px);
  padding: 22px;
  text-align: center;
  border: 5px double #00ff66;
  background: #050505;
  box-shadow: 0 0 28px rgba(0, 255, 102, 0.32);
}

.modal-title {
  color: #ffcc00;
  font-size: 10px;
}

#modal-message {
  color: #ffffff;
  font-family: "VT323", monospace;
  font-size: 26px;
  line-height: 1.2;
}

.admin-indicator {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 200;
  display: none;
  padding: 10px 12px;
  color: #ffffff;
  background: #ff0055;
  font-size: 8px;
  border: 2px solid #ffffff;
}

body.admin-mode .admin-indicator {
  display: block;
}

.shake .arcade-screen {
  animation: shakeScreen 0.22s linear;
}

@keyframes shakeScreen {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@media (max-width: 520px) {
  body {
    padding: 8px 5px;
  }

  .arcade-cabinet {
    padding: 12px;
    border-width: 4px;
    border-radius: 12px;
  }

  #arcade-title {
    font-size: 10px;
  }

  #arcade-subtitle,
  .score-board,
  .hp-label,
  .hp-percent {
    font-size: 8px;
  }

  .arcade-screen {
    padding: 12px;
    min-height: 420px;
    max-height: 82vh;
  }

  .game-play-area {
    height: 220px;
  }

  .falling-item {
    width: 68px;
    height: 68px;
  }

  .catcher-char {
    font-size: 36px;
  }

  .game-hint {
    font-size: 18px;
  }

  .pixel-btn {
    padding: 12px 8px;
    font-size: 7px;
  }

  .stage-clear-banner {
    font-size: 11px;
  }

  .reward-block h2 {
    font-size: 8px;
  }

  .pixel-grid {
    gap: 10px;
  }

  .pixel-frame {
    padding: 6px;
    border-width: 2px;
  }

  .terminal-box {
    font-size: 20px;
    max-height: 260px;
  }

  .gacha-display {
    font-size: 20px;
  }

  .inv-slot {
    font-size: 18px;
  }
}
/* =====================================================
   FIX MOBILE DOUBLE TAP ZOOM SAAT MAIN GAME
===================================================== */

html,
body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

.arcade-cabinet,
.arcade-screen,
.game-play-area,
.game-controls,
.pixel-btn,
.pixel-btn-sm {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pixel-btn,
.pixel-btn-sm {
  -webkit-touch-callout: none;
}