/* Controls & Overlay Styles */
.controls-container {
  margin: 20px auto;
  text-align: center;
  max-width: 720px;
  width: 100%;
  position: relative;
  z-index: 1001;
}

#start-screen .controls-container {
  margin: 10px auto 20px auto;
}

.controls-panel {
  display: none;
  background: linear-gradient(145deg, rgba(175, 95, 38, 0.95), rgba(136, 80, 40, 0.95));
  border: 3px solid #5c4033;
  border-radius: 12px;
  padding: 20px;
  margin-top: 10px;
  color: #fff5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.controls-panel h3 {
  font-family: "Fredericka";
  font-size: 28px;
  margin: 0 0 15px 0;
  color: #ffa07a;
  text-shadow: 1px 1px 2px #000;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.control-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-item .key {
  background: linear-gradient(145deg, #6b4726, #5c4033);
  color: #fff5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  min-width: 40px;
  text-align: center;
  border: 2px solid #3a2817;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: "Fredericka";
  font-size: 16px;
}

.control-item .action {
  font-size: 14px;
  font-weight: 500;
}

#controls-toggle {
  margin: 0;
  font-size: 18px;
  padding: 10px 20px;
}

.overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.overlay-content {
  background: linear-gradient(145deg, rgba(175, 95, 38, 0.98), rgba(136, 80, 40, 0.98));
  border: 4px solid #5c4033;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #fff5e1;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px 10px 25px;
  border-bottom: 2px solid rgba(92, 64, 51, 0.5);
}

.overlay-header h3 {
  font-family: "Fredericka";
  font-size: 28px;
  color: #ffa07a;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: #fff5e1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffa07a;
  transform: none;
  box-shadow: none;
}

.overlay-body {
  padding: 20px 25px;
  line-height: 1.5;
}

.overlay-body p {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.overlay-body strong {
  color: #ffa07a;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.overlay-body ul {
  margin: 10px 0;
  padding-left: 20px;
}

.overlay-body li {
  margin: 5px 0;
  font-size: 15px;
}

/* Controls Media Queries */
@media (max-width: 767px) {
  .controls-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .control-item {
    justify-content: space-between;
    padding: 12px;
  }
  .controls-panel h3 {
    font-size: 24px;
  }
  #start-screen .controls-container {
    display: none;
  }
  #controls-toggle {
    font-size: 16px;
    padding: 8px 16px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .controls-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .control-item {
    justify-content: space-between;
    padding: 12px;
  }
  .controls-panel h3 {
    font-size: 24px;
  }
  #start-screen .controls-container {
    display: none;
  }
  #controls-toggle {
    font-size: 16px;
    padding: 8px 16px;
  }
}
