* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  color: #111111;
  background: #ffffff;
}

main {
  width: min(720px, 100%);
  padding: 24px;
  text-align: center;
}

#level,
#hp,
#xp {
  font-size: 32px;
  font-weight: bold;
}

.item-row {
  font-size: 22px;
  font-weight: bold;
}

#level {
  margin-bottom: 28px;
  font-size: 40px;
  color: #707070;
}

#meters {
  display: grid;
  justify-content: center;
  gap: 8px;
  min-height: 84px;
}

#hp,
#xp {
  width: 300px;
  margin: 0;
  display: grid;
  grid-template-columns: 74px 1fr;
  column-gap: 12px;
  align-items: center;
  text-align: left;
}

.item-status {
  margin-top: 32px;
  display: grid;
  gap: 4px;
}

.item-row {
  width: 300px;
  min-height: 38px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 74px 1fr;
  column-gap: 12px;
  align-items: center;
  text-align: left;
}

#hp {
  color: #991b1b;
}

#xp {
  color: #14532d;
}

.hp-label,
.xp-label,
.item-label {
  font-size: 0.6em;
  line-height: 1;
  transform: translateY(3px);
}

.item-label {
  color: #444444;
}

.item-row span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

#hpBar,
#xpBar {
  min-width: 0;
  overflow-wrap: anywhere;
}

#hpBar {
  justify-self: start;
  width: max-content;
  padding: 4px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #ffffff;
  border: 2px solid #7e22ce;
  border-radius: 2px;
  box-sizing: border-box;
}

.hp-unit {
  width: 0.72em;
  height: 0.72em;
  display: block;
  background: #991b1b;
}

.hp-empty {
  opacity: 0;
}

#expression {
  height: 96px;
  margin: 40px 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  overflow-wrap: anywhere;
  font-size: 48px;
  font-weight: bold;
}

.add-bonus {
  align-self: baseline;
  margin-left: 4px;
  color: #2563eb;
  font-size: 0.4em;
  line-height: 1;
}

.mul-bonus {
  color: #ca8a04;
}

.all-bonus {
  align-self: baseline;
  margin-left: 4px;
  color: #15803d;
  font-size: 0.4em;
  line-height: 1;
}

#actionSlot {
  height: 52px;
  margin: -18px 0 34px;
  display: grid;
  place-items: center;
}

#actionSlot > * {
  grid-area: 1 / 1;
}

#restartButton {
  display: block;
  margin: 0;
  min-width: 80px;
  min-height: 36px;
  border-color: #14532d;
  background: #14532d;
  color: #ffffff;
  font-size: 14px;
}

#restartButton[hidden] {
  display: block;
  visibility: hidden;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
}

#countdown {
  min-height: 32px;
  color: #444444;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
}

#countdown:empty {
  visibility: hidden;
}

#reward {
  min-height: 30px;
  font-size: 24px;
  letter-spacing: 3px;
}

#reward:empty {
  visibility: hidden;
}

.hp-recover {
  color: #991b1b;
}

.gem-blue {
  color: #2563eb;
}

.gem-yellow {
  color: #ca8a04;
}

.gem-green {
  color: #15803d;
}

.gem-gold {
  color: #d97706;
}

.gem-purple {
  color: #7e22ce;
}

button {
  min-width: 120px;
  min-height: 56px;
  border: 2px solid #111111;
  background: #ffffff;
  color: #111111;
  font: inherit;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

@media (max-width: 520px) {
  #level,
  #hp,
  #xp {
    font-size: 26px;
  }

  .item-row {
    font-size: 18px;
  }

  #meters {
    gap: 6px;
  }

  #hp,
  #xp {
    width: 220px;
    grid-template-columns: 50px 1fr;
  }

  .item-row {
    width: 220px;
    grid-template-columns: 50px 1fr;
  }

  #expression {
    font-size: 36px;
  }

  button {
    min-width: 104px;
  }
}
