/* General styling */

* {
  box-sizing: border-box;
}

html {
  font-family: system-ui;
  height: 100%;
  overflow: hidden;
}

body {
  height: inherit;
  background: #ccc;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#wrapper {
  width: 60%;
  max-width: 500px;
}

/* Button bar styling */

#button-bar {
  height: 48px;
  min-width: 300px;
  padding: 8px;
  border-radius: 6px;
  background: #eee;
  box-shadow: 1px 1px 3px #999;
  display: flex;
  justify-content: space-around;
  gap: 10px;
  z-index: 2;
  position: relative;
}

/* Button styling */

#button-bar button {
  border: 1px solid #999;
  border-radius: 4px;
  background: #eee;
  flex: 1;
}

#button-bar button:hover,
#button-bar button:focus {
  background: #ccc;
}

#button-bar button:active {
  box-shadow: inset 1px 1px 2px #333, inset -1px -1px 2px #eee;
}

/* Styling auto popovers */

[popover="auto"] {
  inset: unset;
  position: absolute;
  bottom: calc(anchor(top) + 20px);
  justify-self: anchor-center;
  margin: 0;

  width: 200px;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  background: #eee;
  box-shadow: 1px 1px 3px #999;
  border: none;
}

[popover="auto"] button {
  border: 1px solid #999;
  border-radius: 4px;
  background: #eee;
  width: 100%;
  line-height: 1.5;
}

[popover="auto"] button:first-of-type {
  margin-bottom: 8px;
}

[popover="auto"] button:hover,
[popover="auto"] button:focus {
  background: #ccc;
}

[popover="auto"] button:active {
  box-shadow: inset 1px 1px 2px #333, inset -1px -1px 2px #eee;
}

/* Styling hint popovers */

[popover="hint"] {
  inset: unset;
  position: absolute;
  top: calc(anchor(bottom) + 5px);
  justify-self: anchor-center;
  margin: 0;

  padding: 8px;
  border-radius: 6px;
  background: #271717;
  color: whitesmoke;
  box-shadow: 1px 1px 3px #999;
  border: none;
}

/* Styling help para */

.help-para {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #eee;
  font-size: 0.8rem;
  line-height: 1.3;
  width: 50%;
  max-width: 600px;
  margin: 0;
  padding: 16px;
  box-shadow: 1px 1px 3px #999;
  z-index: 1;
}

.help-para p {
  margin: 0;
}

.help-para p:first-child {
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .help-para {
    width: auto;
    right: 16px;
  }

  #wrapper {
    width: 90%;
  }
}
