/* ============================================
   BHILLION DOLLAR — MOBILE FULLSCREEN BUTTON
   STATUS: FROZEN
   Do not resize or restyle unless redesigning
   the entire mobile control layout.
   ============================================ */

/* ================================
   LOGO + TITLE
   ================================ */

#logo-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 0; /* prevents canvas squeeze */
}

#logo {
    max-width: 25vw;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

@media screen and (max-width: 768px) {
    #logo { max-width: 40vw; }
}

@media screen and (max-width: 480px) {
    #logo { max-width: 50vw; }
}

#title {
    font-style: italic;
    font-family: 'Nosifer', cursive;
    font-size: 6vw;
    color: #ffd700;
    text-shadow:
        4px 4px 5px #000,
        0 0 14px rgba(255, 0, 0, 0.7),
        0 0 22px rgba(255, 215, 0, 0.8);
    text-align: center;
    max-width: 90%;
}

@media screen and (max-width: 768px) {
    #title { font-size: 8vw; }
}

@media screen and (max-width: 480px) {
    #title { font-size: 10vw; }
}

/* ================================
   BODY (FIXED — NO FLEX)
   ================================ */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #000;
    color: #fff;

    /* DO NOT flex the body — breaks header/footer flow */
    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: none;
    touch-action: pinch-zoom pan-y;
}

/* ================================
   WARNING BOX
   ================================ */

.warning-box {
    color: #ff6666;
    font-family: "Courier New", monospace;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 20px auto;
    padding: 10px;
    background-color: rgba(255,0,0,0.15);
    border: 2px solid red;
    border-radius: 8px;
    max-width: 80%;
    text-shadow: 0 0 8px rgba(0,0,0,0.8);
}


/* ================================
   MAIN CONTAINERS
   ================================ */

#main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#ui-container {
    display: inline-block;
    width: 90%;
    max-width: 1100px;
    padding: 10px;
    background: linear-gradient(90deg, #111, #222);
    border: 2px solid #555;
    border-radius: 8px;
    box-shadow:
        0 0 18px rgba(0,0,0,0.8),
        0 0 20px rgba(255, 215, 0, 0.18);
    text-align: center;
    margin-bottom: 10px;
}

#ui-container h2,
#ui-container h3 {
    margin: 10px auto;
    color: gold;
    text-shadow: 0 0 10px rgba(255,215,0,0.6);
}

/* ================================
   HEALTH / ENEMY INFO DISPLAY
   ================================ */

#health-bar-container,
#enemy-count {
    display: flex;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 15px;
    background: rgba(30,30,30,0.9);
    border-radius: 8px;
    color: #ffe8a0;
    text-shadow: 1px 1px 4px #000;
    width: 96%;
    margin: 2px;
    border: 1px solid #555;
}

#health-bar {
    width: 75%;
    height: 20px;
    background-color: #550000;
    border-radius: 12px;
    border: 2px solid #333;
    overflow: hidden;
    margin-right: 2px;
}

#health-bar-inner {
    width: 100%;
    height: 100%;
    background-color: #00aa00;
    transition: width .3s ease-in-out;
}

/* ================================
   GAME CONTAINER (DO NOT TOUCH)
   ================================ */

    #game-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;

    border-radius: 10px;
    border: 2px solid #444;
    background: radial-gradient(circle at top, #222 0%, #000 55%, #000 100%);
    box-shadow:
        0 0 20px rgba(0,0,0,0.9),
        0 0 20px rgba(255,215,0,0.2);

    position: relative;
    overflow: hidden;
    }

    /* ================================
   FULLSCREEN OVERRIDES (FIXES MOBILE LANDSCAPE + INPUT DESYNC)
   ================================ */

    /* When we go fullscreen, we temporarily remove aspect-ratio constraints
    so the game can truly fill the screen on mobile landscape. */
    #game-container.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    }

    /* Make sure the canvas is a real block and can receive touches/clicks reliably */
    #game-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; /* stop browser gestures from stealing touch */
    }

/* ================================
   CONTROLS
   ================================ */

#onscreen-controls {
    position: relative;
    width: 75%;
    margin: 3px auto;
    padding: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.6);
    border: 2px solid #555;
    border-radius: 12px;
}

#center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
}

#joystick-area {
    position: relative;
    width: 125px;
    height: 100px;
    margin-top: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, #555 50%, #333 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    touch-action: none;
}

#joystick-knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(180deg, #777, #444);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.6);
}

#attack-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #777, #333);
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.6);
}

/* ================================
   MOBILE-ONLY FULLSCREEN BUTTON
   ================================ */

#mobile-fullscreen-button {
    display: none; /* hidden by default (desktop) */
}

/* ================================
   FULLSCREEN WRAPPER (FIXED)
   ================================ */

#fullscreen {
    width: 100%;
    display: flex;
    flex-direction: column;

    justify-content: flex-start;
    align-items: center;

    background: #000;
    padding: 2px;
    transition: all .3s ease-in-out;
    pointer-events: auto; /* FIX */
}


/* Re-enable interaction for UI elements inside */
#health-bar-container,
#enemy-count,
#boss-health-bar-container,
#mobile-fullscreen-button,
#ios-share-button {
  pointer-events: auto;
}

#game-container,
#game-container canvas {
  pointer-events: auto;
}

#game-container canvas {
  display: block;
}
#game-container {
  aspect-ratio: 1100 / 500;
}


/* ================================
   INSTRUCTIONS BUTTON
   ================================ */

.ui-button-instructions {
    margin-top: 8px;
    width: 160px;
    align-self: center;
}

#open-instructions {
    display: inline-block;
    margin: 10px auto 14px auto;
    padding: 10px 22px;
    font-size: 16px;
    font-weight: bold;
    color: black;
    background: linear-gradient(180deg, #ffd700, #e0b000);
    border: 2px solid #d4af37;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.35),
        0 0 18px rgba(255, 215, 0, 0.15);
    transition: all .18s ease;
}

#open-instructions:hover {
    background: linear-gradient(180deg, #ffe68a, #eac546);
    transform: translateY(-2px);
}

#open-instructions:active {
    transform: scale(0.97);
    background: #d4af37;
}

/* ================================
   TOP-LEFT LOGO
   ================================ */

.top-left-logo {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 99999;
    display: block;
}

.top-left-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    padding: 4px;
    background: rgba(0,0,0,0.45);
    border: 2px solid #d4af37;
    box-shadow: 0 0 14px rgba(212,175,55,0.40);
}

@media (max-width: 600px) {
    .top-left-logo img {
        width: 56px;
        height: 56px;
    }
}

@media (orientation: landscape) and (max-width: 900px) {
  #onscreen-controls {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
  }
}


  #game-container {
    max-height: 100vh;
  }

/* ================================
   BHILLION DOLLAR — MOBILE FULLSCREEN BUTTON (COMPACT)
   ================================ */

#mobile-fullscreen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 92px;
  height: 36px;
  padding: 0 12px;

  font-family: 'Metal Mania', cursive;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;

  color: #000;
  background: linear-gradient(
    180deg,
    #ffd700 0%,
    #e6b800 65%,
    #cfa300 100%
  );

  border: 2px solid #d4af37;
  border-radius: 10px;

  box-shadow:
    0 0 8px rgba(255, 215, 0, 0.35),
    0 3px 8px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255,255,255,0.3);

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.1s ease;
}

#mobile-fullscreen-button:active {
  transform: scale(0.95);
  box-shadow:
    0 0 6px rgba(255, 215, 0, 0.25),
    inset 0 2px 6px rgba(0,0,0,0.6);
}

#mobile-fullscreen-button::before {
  content: "⛶";
  font-size: 14px;
  margin-right: 6px;
}
/* ================================
   IOS ADD TO HOME SCREEN MODAL
================================ */

.ios-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.ios-modal-backdrop.hidden {
  display: none;
}

.ios-modal {
  width: 90%;
  max-width: 420px;
  background: radial-gradient(circle at top, #222, #000);
  border: 2px solid #d4af37;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  box-shadow:
    0 0 30px rgba(0,0,0,0.9),
    0 0 22px rgba(255,215,0,0.25);
}

.ios-modal h2 {
  color: gold;
  margin-bottom: 10px;
  text-shadow: 0 0 12px rgba(255,215,0,0.6);
}

.ios-modal p,
.ios-modal li {
  color: #eee;
  font-size: 15px;
}

.ios-modal ol {
  text-align: left;
  margin: 15px auto;
  max-width: 260px;
}

.ios-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.gold-btn {
  flex: 1;
  padding: 10px;
  font-weight: bold;
  background: linear-gradient(180deg, #ffd700, #e0b000);
  border: 2px solid #d4af37;
  border-radius: 10px;
  cursor: pointer;
}

.dark-btn {
  flex: 1;
  padding: 10px;
  background: #111;
  color: #aaa;
  border: 2px solid #444;
  border-radius: 10px;
  cursor: pointer;
}
/* =========================================================
   GAME MODE — HIDE INJECTED SITE UI (HEADER + BHILLY)
   TURBO NEGRO V1 — FINAL
   ========================================================= */

/* Global Header (injected, replaces holder) */
body.game-active header,
body.game-active .global-header,
body.game-active .bd-header,
body.game-active [data-bd-header] {
  display: none !important;
}

/* =========================
   BOSS HEALTH BAR (FIX)
========================= */

#boss-health-bar {
  width: 200px;              /* 🔥 REQUIRED */
  height: 14px;
  background-color: #400;
  border-radius: 8px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

#boss-health-bar-inner {
  height: 100%;
  width: 100%;
  background-color: red;
  transition: width 0.2s linear;
}

#admin-disconnect {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 99999;

  background: rgba(0,0,0,0.8);
  color: red;
  border: 2px solid red;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* =========================
   CONTROLLER QR OVERLAY
========================= */
#controller-qr-container {
  position: absolute;
  top: 72px;
  left: 20px;
  z-index: 50;
  text-align: left;
}

#controller-qr-text {
  margin-top: 4px;
  font-family: "Metal Mania", cursive;
  font-size: 13px;
  color: #FFD700;
  text-shadow: 2px 2px 0 #000;
}
