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

html, body {
  overflow: auto;
  scrollbar-width: none;
  background: black;
}

/* hide the scroll bar visually on other browsers */
html::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none;
}

/* Loading overlay for first-time map/skin import */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loading-overlay.hidden {
  display: none;
}

#loading-content {
  text-align: center;
  color: white;
  font-family: sans-serif;
}

#loading-status {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

#loading-progress {
  font-size: 1.1rem;
  color: #aaa;
}

canvas {
  display: block;
}

/* #region drag and drop */

/* The whole window is a drop target, so the confirmation that a drag has been seen has
   to be the whole window too. Never takes pointer events: #drop-zone underneath is what
   actually receives the drop. */
#drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  pointer-events: none;
}

#drop-overlay.active {
  display: flex;
}

#drop-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 5rem;
  border: 3px dashed #22cc22;
  border-radius: 16px;
  color: #fff;
  font-family: sans-serif;
  text-align: center;
}

#drop-overlay-icon {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: #22cc22;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#drop-overlay-title {
  font-size: 2rem;
  font-weight: 700;
  white-space: normal;
}

#drop-overlay-hint {
  font-size: 1rem;
  color: #aaa;
  white-space: normal;
}

/* #region toasts */

#toast-area {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9997;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 320px;
  pointer-events: none;
}

.toast {
  background: #16161c;
  border: 1px solid #2233cc;
  border-left: 4px solid #2233cc;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-family: sans-serif;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

.toast-done {
  border-color: #22aa44;
  border-left-color: #22aa44;
}

.toast-failed {
  border-color: #cc3333;
  border-left-color: #cc3333;
}

.toast-leaving {
  opacity: 0;
}

.toast-text {
  display: block;
  white-space: normal;
  word-break: break-word;
}

.toast-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.toast-fill {
  height: 100%;
  width: 0;
  background: #22cc22;
  transition: width 0.15s linear;
}

.toast-done .toast-fill {
  background: #22aa44;
}

.toast-failed .toast-fill {
  background: #cc3333;
}

.mapset {
  border-radius: 10px;
  margin-bottom: 1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mapset-header {
  background-size: cover;
  background-position: center;
  padding: 1em;
  color: white;
  cursor: pointer;
  font-weight: bold;
  text-shadow: 0 0 5px black;
}

.mapset-difficulties {
  background: rgba(0,0,0,0.3);
  padding: 0.5em 1em;
  text-align: right;
}

.difficulty {
  margin: 0.25em 0;
  color: #ddd;
  cursor: pointer;
}

.hidden {
  display: none;
}

#settings-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 99;
}

#settings {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 20px;
  overflow-y: auto;
}

textarea {
  resize: none;
}


.game-navigation-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

#beatmap-container {
  width: 45%;
}

#map-information {
  position: fixed;
  top: 0;
  left: 0;
  width: 45vw;
  height: 100vh;
  background: gray;
}

h3, p{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* the settings panel is a dark overlay, so anything written on it needs a colour of
   its own - the browser default is black on black */
.settings-heading {
  margin: 1.5rem 0 0.75rem;
  font-family: sans-serif;
  font-size: 1.1rem;
  color: #22cc22;
}

.settings-heading:first-child {
  margin-top: 0;
}

/* the volume control: a slider, and the percentage as a box you can type into */
.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 400px;
}

#volume-slider {
  flex: 1;
  height: 8px;
  accent-color: #22cc22;
  cursor: pointer;
}

.volume-percent {
  width: 72px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #2233cc;
  background: #fff;
  color: #111;
  text-align: center;
  font-weight: 600;
}

.volume-percent:focus {
  outline: none;
  background: #f0f0f0;
}

/* styling for the key inputs. They are readonly and set by pressing a key, so they are
   styled to read as a display rather than as something to type into */
.keybind-input input {
  width: 400px;
  margin-bottom: 10px;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid #2233cc;
  background: transparent;
  color: white;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
}

.keybind-input input:focus {
  outline: none;
  border-color: #22cc22;
  background-color: #000;
}



/* dropdown box for selection of profiles */
.settings {
  padding: 1rem;
} 

.select-box {
  display: flex;
  flex-direction: column;
  width: 400px;
}

.selected {
  position: relative;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #2233cc;
  margin-bottom: 10px;
  background: #fff;
  color: #111;
  font-weight: 600;
  padding: 12px 24px;
}
.selected::placeholder {
  color: #667;
  font-weight: 600;
}
.selected:focus {
  outline: none;
  background: #f0f0f0;
}

/* A profile forked from the immutable default has no name of its own yet. Red is the
   whole prompt - there is nothing to dismiss, and it turns back to white the moment the
   name is actually changed. */
.selected.needs-name {
  background: #cc3333;
  border-color: #cc3333;
  color: #fff;
}
.selected.needs-name::placeholder {
  color: rgba(255, 255, 255, 0.8);
}
/* focused, it is the same red with white mixed into it rather than another colour */
.selected.needs-name:focus {
  background: #dd6b6b;
}

.input-container {
  position: relative;
}

.options-container {
  background: #333388;
  color: black;
  width: 100%;
  transition: all 0.5s;
  border-radius: 8px;
  overflow: hidden;
  
  opacity: 0; 
  max-height: 0;
}
.options-container.active {
  max-height: 240px;
  border: 1px solid red;
  opacity: 1;
  overflow-y: scroll;
}
.options-container::-webkit-scrollbar {
  width: 8px;
  background: white;
  border-radius: 0 8px 8px 0;
}
.options-container::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 0 8px 8px 0;
}
.option {
  padding: 12px 24px;
  cursor: pointer;
}
.option:hover {
  background: black;
  color: white;
}
/* the profile currently being played as */
.option-active {
  font-weight: 700;
  color: #22cc22;
}

/* Always the last entry in the profile list, and green rather than white so that it
   reads as an action and not as one more profile to switch to. */
.option-add {
  background: #22aa44;
  color: #fff;
  font-weight: 700;
}
.option-add:hover {
  background: #1c8837;
  color: #fff;
}
