/* Floating menu styles */
#floating-menu {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-menu);
  padding: 10px 20px;
  border-radius: var(--border-radius);
  overflow-y: auto;
  height: 90vh;
  /* <-- set max height for scrollable area */
  max-height: 90vh;
  /* <-- ensure it doesn't exceed viewport */
  box-sizing: border-box;
}

#floating-menu-ad {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 9999;
  width: 100%;
  height: 10%;
  max-width: 700px;
  pointer-events: auto;
  background: none;
  display: none;
}

#floating-menu[style*="display: flex"]~#floating-menu-ad,
#floating-menu:has(~ #floating-menu-ad) {
  display: block;
}

#levels-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 20px;
}

#floating-menu h1 {
  margin-bottom: 20px;
}

#floating-menu h2 {
  margin-top: 20px;
  margin-bottom: 10px;
}

#record-button,
#custom-level-play-button,
#custom-level-edit-button,
#export-button {
  margin-bottom: 20px;
}

/* Remove margin-bottom for play/edit buttons so they align horizontally */
#custom-level-play-button,
#custom-level-edit-button {
  margin-bottom: 0;
}

#custom-level-input {
  min-height: 300px;
}

#custom-level-buttons-row {
  display: flex;
  gap: 12px;
  align-items: center;
}


#js-docs-link {
  font-size: 18px;
  padding: 8px 16px;
  background: #333;
  color: #ffd700;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 20px;
}

#js-docs-link:hover {
  background: #444;
  color: #fff700;
}

#settings-title {
  margin-bottom: 8px;
  text-align: center;
}

#main-menu-volume-container,
#main-menu-sfx-volume-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 0;
  /* <-- remove extra bottom margin */
  gap: 12px;
  /* <-- add gap for consistent spacing */
  width: 320px;
  /* <-- fixed width for alignment */
  justify-content: flex-start;
  /* <-- align left */
}

#main-menu-volume-container label,
#main-menu-sfx-volume-container label {
  margin-right: 10px;
  color: var(--color-white);
  font-size: 18px;
  width: 110px;
  /* <-- fixed width for label alignment */
  text-align: right;
  /* <-- align label text right */
  display: inline-block;
  /* <-- ensure label width applies */
}

.slider {
  width: 200px;
  margin-bottom: 0;
  vertical-align: middle;
  /* <-- align slider vertically */
}


.big-menu-button {
  font-size: 20px;
  padding: 16px 32px;
  background: #ffd700;
  color: #222;
  border-radius: 10px;
  border: none;
  margin-bottom: 10px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  display: block;
  max-width: 400px;

  .big-menu-button:hover {
    background: #ffe066;
    color: #111;
  }

  #editor-speed-container {
    /* Already styled inline, but you can move it here if you want */
    position: absolute;
    top: 70px;
    right: 30px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

#main-menu-sidebyside-wrapper {
  display: flex;
  flex-direction: row;
  gap: 18px;
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}

#main-menu-sidebyside-wrapper .big-menu-button {
  margin-bottom: 0;
  max-width: 200px;
  flex: 1 1 0;
}

#controls-rebind-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: 10001;
  background: var(--bg-menu);
  border-radius: 0;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.7);
  padding: 48px 0 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  justify-content: flex-start;
}

#controls-rebind-list {
  width: 90%;
  max-width: 600px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
}

#controls-rebind-panel h2 {
  margin-bottom: 10px;
  font-size: 2em;
  text-align: center;
}

#controls-rebind-close {
  margin-top: 24px;
  font-size: 1.1em;
  padding: 12px 32px;
  background: #444;
  color: #fff;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}

#controls-rebind-close:hover {
  background: #666;
  color: #ffd700;
}

.controls-rebind-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  background: #333;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1.1em;
  gap: 10px;
}

.controls-rebind-btn {
  flex: 0 0 auto;
  font-size: 1em;
  padding: 4px 14px;
  background: #ffd700;
  color: #222;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
  margin-right: 18px;
}

.controls-rebind-btn:hover {
  background: #ffe066;
  color: #111;
}

.controls-rebind-label {
  flex: 1 1 0;
  text-align: left;
  color: #ffd700;
  font-weight: bold;
  font-family: monospace;
  margin-right: 32px;
}

.controls-rebind-key {
  flex: 0 0 auto;
  min-width: 60px;
  text-align: center;
  color: #fff;
  background: #444;
  border-radius: 4px;
  padding: 2px 10px;
  margin-right: 10px;
  margin-left: 0;
  font-family: monospace;
}

#main-menu-settings-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#main-menu-rebind-controls-button {
  align-self: center;
  margin-top: 18px;
}