:root {
  --text: #333;
  --gap: 0.5rem;
}

html,
body {
  height: 100%;
}

body {
  color: var(--text);
  font-family: system-ui;
  margin: 0;
}

button,
input {
  border-radius: 0;
  font: inherit;
}

#game {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#game header {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 1rem;
  justify-content: center;
}

#game .character-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tts-toggle {
  align-items: center;
  display: flex;
  gap: var(--gap);
  position: absolute;
  right: 1rem;
  top: 1rem;
}

#character {
  font-size: 5rem;
}

#bubble,
#bubble::before,
#bubble::after {
  background-color: white;
  border: 2px solid black;
  border-radius: 100%;
  box-shadow: 0.25rem 0.25rem 0 hsla(0, 0%, 0%, 15%);
}

#bubble {
  bottom: calc(100% + 1.5rem);
  font-weight: bold;
  min-width: 10rem;
  padding: 1.5rem;
  position: absolute;
  text-align: center;
  text-transform: uppercase;
  word-break: break-word;
}

#bubble[hidden] {
  opacity: 0;
}

#bubble::before,
#bubble::after {
  content: "";
  position: absolute;
}

#bubble::before {
  height: 1rem;
  width: 1rem;
  left: 50%;
  top: calc(100% + 0.5rem);
}

#bubble::after {
  height: 0.5rem;
  width: 0.5rem;
  left: 40%;
  top: calc(100% + 2rem);
}

#form {
  border-top: 2px solid black;
  display: flex;
  padding: var(--gap);
}

#form label {
  align-self: center;
  font-weight: bold;
}

#form input {
  border: 2px solid black;
  flex-grow: 1;
  padding: var(--gap);
  margin: 0 var(--gap);
}

#form button {
  background-color: black;
  border: none;
  color: white;
  padding: var(--gap) calc(var(--gap) * 2);
}

#form :disabled {
  cursor: wait;
  opacity: 0.6;
}

#form *:focus {
  box-shadow: 0 0 0 0.25rem hsl(0, 0%, 67%);
  outline: none;
}
