*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #0d1117;
  color: #e6edf3;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ---------- Canvas Wrapper ---------- */
#canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 60px);
  background: #0d1117;
}

#game-canvas {
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(35, 197, 94, 0.15);
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* ---------- Overlay ---------- */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  z-index: 10;
}

#overlay-content {
  text-align: center;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 32px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: popIn 0.25s ease;
  width: 90%;
  max-width: 380px;
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#overlay-title {
  font-size: 2.2rem;
  color: #f85149;
  margin-bottom: 10px;
}

#overlay-message {
  font-size: 1.1rem;
  color: #8b949e;
  margin-bottom: 24px;
}

#overlay-btn {
  padding: 12px 32px;
  background: #23c55e;
  color: #0d1117;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#overlay-btn:hover  { background: #1aab52; transform: translateY(-1px); }
#overlay-btn:active { transform: translateY(0); }

.overlay-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

#overlay-menu-btn {
  padding: 12px 32px;
  background: transparent;
  color: #8b949e;
  border: 1px solid #30363d;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}

#overlay-menu-btn:hover  {
  background: #21262d;
  color: #e6edf3;
  border-color: #8b949e;
  transform: translateY(-1px);
}
#overlay-menu-btn:active { transform: translateY(0); }

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 700px) {
  #canvas-wrapper {
    height: calc(100vh - 60px);
    align-items: center;
  }

  #overlay-title  { font-size: 1.4rem; }
  #overlay-message { font-size: 0.88rem; }
  #overlay-content { padding: 24px 20px; }
}
