/* ============================================================
   BANANA GAME — GLOBAL STYLES
============================================================ */

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Courier New', monospace;
  background-color: #0a0a1a;
  color: #e8e8e8;
}

/* CONTROL ROOM BACKGROUND */
.control-room-bg {
  background: url('images/controlroom.jpg') center center / cover no-repeat fixed;
  min-height: 100vh;
  width: 100%;
}

/* GAME LAYOUT */
.game-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  padding: 10px;
  gap: 10px;
}

/* GAME MONITOR */
.game-monitor {
  width: 79%;
  background: #000;
  border: 6px solid #ffe100;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(255,225,0,0.25);
  overflow: hidden;
  position: relative;
}

/* SHARE BUTTONS — Banana Game Theme */
#share-area {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#share-area .end-btn {
  width: 220px;
  text-align: center;
  font-size: 18px;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.25s ease;
}

/* Copy Link button */
#share-area .copy-link-btn {
  background: #ffd84a;
  color: #000;
  box-shadow: 0 0 12px rgba(255, 216, 74, 0.7);
}
#share-area .copy-link-btn:hover {
  background: #ffea8a;
  box-shadow: 0 0 18px rgba(255, 216, 74, 1);
}

/* Facebook button */
#share-area .fb-btn {
  background: #1877f2;
  color: #fff;
  box-shadow: 0 0 12px rgba(24, 119, 242, 0.7);
}
#share-area .fb-btn:hover {
  background: #3b8bff;
  box-shadow: 0 0 18px rgba(24, 119, 242, 1);
}

/* Twitter/X button */
#share-area .tw-btn {
  background: #000;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}
#share-area .tw-btn:hover {
  background: #222;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
}

/* ============================================================
   FIXED CHAT BOX + CHATANGO IFRAME
============================================================ */
.chat-box {
  width: 19%;
  height: 100vh;
  border: 3px solid #ffe100;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 0 20px rgba(255,225,0,0.25);
}

.chat-iframe {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
}

/* CHAT WRAPPER */
.chat-wrapper {
  width: 100%;
  height: 100%;
  min-width: 300px;
}

@media (max-width: 768px) {
  .chat-wrapper {
    min-width: 0;
    height: 25vh;
  }
}

/* GAME BACKGROUND */
#game-bg {
  position: relative;
  width: 100%;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* CONVEYOR BELT */
#conveyor {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 25%;
  background: rgba(0,0,0,0.45);
  overflow: hidden;
  border-top: 3px solid #ffe100;
}

/* EMOJIS */
.emoji {
  position: absolute;
  font-size: 3.8rem;
  bottom: 40px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
  text-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.emoji:hover {
  transform: scale(1.15);
}

/* RED BUTTON */
#red-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: red;
  color: #fff;
  font-weight: 900;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255,0,0,0.5);
  z-index: 999;
}

/* HEARTS */
#hearts {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 2rem;
  color: #ff4444;
  text-shadow: 0 0 10px #ff0000;
}

/* SCORE */
#score {
  position: absolute;
  top: 10px;
  left: 120px;
  font-size: 1.6rem;
  color: #ffe100;
  text-shadow: 0 0 10px #ffe100;
}

/* END SCREEN */
#end-screen {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  color: #ffe100;
  text-align: center;
  padding-top: 120px;
  font-size: 1.4rem;
}

.end-box {
  background: rgba(10,10,30,0.9);
  border: 3px solid #ffe100;
  border-radius: 16px;
  padding: 40px;
  width: 60%;
  margin: auto;
  box-shadow: 0 0 40px rgba(255,225,0,0.3);
}

/* START OVERLAY */
#start-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 999;
}

#start-btn {
  padding: 16px 30px;
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg,#ffe100,#ff8c00);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255,225,0,0.4);
}

/* ============================================================
   DESKTOP LOCK
============================================================ */
@media (min-width: 769px) {

  .game-wrapper {
    flex-direction: row;
    height: 100vh;
  }

  .game-monitor {
    width: 79%;
    height: 100vh;
  }

  .game-monitor iframe {
    width: 100%;
    height: 100%;
  }

  .chat-box {
    width: 19%;
    height: 100vh;
  }

  .chat-iframe {
    width: 100%;
    height: 100%;
  }
}

/* ============================================================
   MOBILE FIX — FINAL WORKING VERSION
============================================================ */
@media (max-width: 768px) {

  .game-wrapper {
    flex-direction: column;
    height: auto;
  }

  /* GAME gets all remaining space after chat */
  .game-monitor {
    width: 100%;
    height: calc(100vh - 25vh);
    position: relative;
  }

  .game-monitor iframe {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* CHAT stays fixed at 25vh */
  .chat-box {
    width: 100%;
    height: 25vh;
    min-width: 0;
  }

  .chat-iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
  }
}
