html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #1a0033;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

#container {
  position: relative;
  width: 100%;
  height: 100%;
}

#input_video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 0;
  opacity: 0;
}

#game_canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ============================= */
/* POPPY MAIN MENU GRID */
/* ============================= */

#menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10; /* Lower than pause button/overlay */
  padding: 20px;
}

#menu h1 {
  color: #ffffff;
  text-shadow: 0 0 10px #ff00ff;
  font-size: clamp(2rem, 8vw, 3.5rem);
  margin-bottom: 30px;
  text-transform: uppercase;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  width: 95%;
  max-width: 1200px;
  height: 60vh;
}

#menu button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  color: white;
  font-weight: bold;
  font-size: clamp(0.7rem, 2vh, 1rem);
  transition: transform 0.2s;
  box-shadow: 0 6px 0 rgba(0,0,0,0.3);
}

#menu button span {
  font-size: clamp(1.5rem, 5vh, 3rem);
  margin-bottom: 8px;
}

.tile-1, .tile-10 { background: #FF3D6E; } 
.tile-2, .tile-9 { background: #00D2FF; } 
.tile-3, .tile-6 { background: #e2c102; color: #333; } 
.tile-4, .tile-11 { background: #A033FF; } 
.tile-5, .tile-8 { background: #2DFF8E; color: #111; }

#menu button:hover { transform: translateY(-5px) scale(1.02); }

@media (max-width: 800px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(5, 1fr);
    height: 75vh;
  }
}

/* ============================= */
/* PAUSE UI - FIXED & RIGHT ALIGNED */
/* ============================= */

#pauseBtn {
  position: absolute;
  top: 15px;
  right: 15px; /* Back to the right side */
  z-index: 100;
  width: 50px;
  height: 50px;
  background: #000000;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pauseOverlay {
  position: fixed; 
  inset: 0;
  display: none; 
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
}

#changeModeBtn {
  display: none;
}

.pauseBox {
  background: white;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  width: 280px;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
}

.pauseBox h2 { 
  color: #333; 
  margin-bottom: 25px; 
  font-size: 1.8rem;
}

.pauseBox button {
  width: 100%;
  padding: 15px;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  background: #f0f0f0;
  color: #333;
  transition: background 0.2s;
}

.pauseBox button:hover {
  background: #e0e0e0;
}