/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: sans-serif;
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  touch-action: none;
}

#brand-container {
  text-align: center;
  transition: opacity 1s;
}

#brand-title {
  font-size: 4rem;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #fff;
  }

  to {
    text-shadow: 0 0 20px #0ff;
  }
}

#interaction-prompt {
  margin-top: 1rem;
  font-size: 1.2rem;
  opacity: 0.8;
}

#game-container {
  display: none;
  /* hidden until triggered */
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: #000;
  /* Ensure visible background */
  visibility: visible;
  /* Make sure it's visible when displayed */
  overflow: hidden;
  /* Prevent scrolling */
  touch-action: none;
  /* Disable browser's default touch actions */
}

/* Mobile Controls */
#mobile-controls {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: none;
  /* Hidden by default, shown only on mobile */
  touch-action: none;
  /* Prevent default touch actions */
  pointer-events: none;
  /* Allow touches to pass through to game by default */
}

/* Touch overlay for better swipe detection */
#touch-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70%;
  /* Cover most of the screen except bottom where controls are */
  pointer-events: auto;
  /* Capture touches on this element */
  z-index: 100;
  background: transparent;
  /* Ensure overlay is completely transparent */
  opacity: 0;
  /* Make sure it's fully transparent */
}

#mobile-buttons {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(3, 60px);
  gap: 5px;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  /* Make sure buttons can be clicked */
  opacity: 0.8;
  /* Make buttons slightly transparent */
}

/* Sound toggle button */
#sound-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 100, 200, 0.3);
  border: 2px solid rgba(0, 200, 255, 0.6);
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  display: none;
  /* Hidden initially, shown when game starts */
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 200;
  transition: background 0.2s, transform 0.1s;
}

#sound-toggle:hover {
  background: rgba(0, 150, 255, 0.4);
}

#sound-toggle:active {
  transform: scale(0.95);
}

/* Dev Button (temporarily visible for testing) */
#dev-form-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 0, 0, 0.7);
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 150;
  padding: 0;
  margin: 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.mobile-btn {
  width: 60px;
  height: 60px;
  background: rgba(0, 150, 255, 0.4);
  border: 2px solid rgba(0, 200, 255, 0.8);
  color: rgba(255, 255, 255, 1);
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  /* Remove tap highlight on iOS */
  box-shadow: 0 0 10px rgba(0, 150, 255, 0.5);
  /* Add subtle glow */
}

.mobile-btn:active {
  background: rgba(0, 200, 255, 0.6);
  transform: scale(0.95);
}

#up-btn {
  grid-column: 2;
  grid-row: 1;
}

#left-btn {
  grid-column: 1;
  grid-row: 2;
}

#right-btn {
  grid-column: 3;
  grid-row: 2;
}

#down-btn {
  grid-column: 2;
  grid-row: 3;
}

/* Hide mobile controls on desktop */
@media (min-width: 768px) {
  #mobile-controls {
    display: none !important;
  }
}

/* Contact Form Styles */
#contact-form-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  /* Hidden initially */
  justify-content: center;
  align-items: center;
  z-index: 300;
}

#contact-form-panel {
  background: linear-gradient(to bottom right, #04102b, #071a42);
  border: 2px solid #0af;
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 30px rgba(0, 150, 255, 0.5);
  color: white;
  text-align: center;
}

#contact-form-panel h2 {
  color: #0ff;
  margin-bottom: 15px;
  font-size: 28px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

#contact-form-panel p {
  margin-bottom: 20px;
  opacity: 0.9;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
  color: #0af;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #0af;
  background: rgba(0, 20, 50, 0.5);
  color: white;
  border-radius: 5px;
  font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0ff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

#submit-form {
  background: linear-gradient(to right, #0066cc, #0099ff);
  border: none;
  color: white;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.1s, box-shadow 0.2s;
}

#submit-form:hover {
  background: linear-gradient(to right, #0070dd, #00aaff);
  box-shadow: 0 0 15px rgba(0, 150, 255, 0.7);
}

#submit-form:active {
  transform: scale(0.98);
}

.checkbox-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin: 15px 0;
}

.checkbox-group input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  vertical-align: middle;
  width: auto;
}

.checkbox-group label {
  display: inline;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  cursor: pointer;
  white-space: normal;
}

.checkbox-group a {
  color: #0af;
  text-decoration: none;
}

.checkbox-group a:hover {
  text-decoration: underline;
  color: #0ff;
}

#continue-playing {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 100, 150, 0.7);
  color: white;
  border: 1px solid #0af;
  padding: 8px 15px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

#continue-playing:hover {
  background: rgba(0, 150, 200, 0.8);
}

/* Styles for submission summary */
.submission-summary {
  background: rgba(0, 20, 60, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  text-align: left;
  border: 1px solid rgba(0, 150, 255, 0.3);
}

.submission-summary p {
  margin: 8px 0;
}

.note {
  font-size: 14px;
  margin-top: 20px;
  opacity: 0.8;
}

.note a {
  color: #0af;
  text-decoration: none;
}

.note a:hover {
  text-decoration: underline;
  color: #0ff;
}

#continue-after-submit {
  background: linear-gradient(to right, #0066cc, #0099ff);
  border: none;
  color: white;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 25px;
  transition: transform 0.1s, box-shadow 0.2s;
}

#continue-after-submit:hover {
  background: linear-gradient(to right, #0070dd, #00aaff);
  box-shadow: 0 0 15px rgba(0, 150, 255, 0.7);
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
  #mobile-buttons {
    grid-template-columns: repeat(3, 55px);
    grid-template-rows: repeat(3, 55px);
    gap: 8px;
    /* Slightly more space between buttons */
    bottom: 40px;
    /* Move controls higher from bottom edge */
  }

  .mobile-btn {
    width: 55px;
    height: 55px;
    font-size: 24px;
  }

  /* Scale down text for smaller screens */
  #brand-title {
    font-size: 3rem;
  }

  #interaction-prompt {
    font-size: 1rem;
  }

  #contact-form-panel {
    padding: 20px;
    width: 95%;
    max-height: 85vh;
    /* Prevent overflow on small screens */
    overflow-y: auto;
    /* Allow scrolling if needed */
  }

  #continue-playing {
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Reduce size of sound toggle for mobile */
  #sound-toggle {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  /* Make dev form button smaller and less obtrusive */
  #dev-form-button {
    bottom: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}