@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-mono-latin-700-normal.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Roboto Mono", monospace;
  background: #05060f;
  color: #e8ebee;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 480px;
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
}

.back {
  color: #9aa4af;
  font-size: 0.85rem;
  text-decoration: none;
}

.back:hover,
.back:focus-visible {
  color: #e8ebee;
}

.buttons {
  display: flex;
  gap: 0.5rem;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.buttons button {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  background: #181c22;
  border: 1px solid #2a313a;
  border-radius: 0.5rem;
}

button:focus-visible {
  outline: 2px solid #7aa7ff;
  outline-offset: 2px;
}

.stage {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 0.5rem 0.5rem;
}

canvas {
  display: block;
  border: 1px solid #2a313a;
  border-radius: 0.5rem;
  background: #05060f;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92%, 420px);
  max-height: 96%;
  overflow-y: auto;
  padding: 1.25rem;
  text-align: center;
  background: rgb(10 12 28 / 92%);
  border: 1px solid #3b3f6b;
  border-radius: 0.75rem;
  box-shadow: 0 0 40px rgb(122 167 255 / 25%);
}

.overlay[hidden] {
  display: none;
}

.overlay h1 {
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: #7dd3fc;
  text-shadow: 0 0 12px rgb(125 211 252 / 60%);
}

.overlay-body {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.overlay-body p + p,
.overlay-body p + ul,
.overlay-body ul + ul,
.overlay-body ul + p {
  margin-top: 0.75rem;
}

.help,
.legend {
  list-style: none;
  padding: 0;
  text-align: left;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.pu {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.3rem;
  line-height: 1.4rem;
  text-align: center;
  font-weight: 700;
  color: #05060f;
  border-radius: 50%;
}

.pu-p {
  background: #60a5fa;
}

.pu-r {
  background: #fb923c;
}

.pu-s {
  background: #34d399;
}

.pu-b {
  background: #f87171;
}

.pu-l {
  background: #f472b6;
}

.tip {
  color: #facc15;
}

.big {
  font-size: 1.6rem;
  font-weight: 700;
  color: #facc15;
}

.best {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #9aa4af;
}

.best:empty {
  display: none;
}

.start {
  margin-top: 1rem;
  padding: 0.7rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #05060f;
  background: #7dd3fc;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0 16px rgb(125 211 252 / 50%);
}

.start:hover {
  background: #bae6fd;
}

.bomb {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.6rem;
  background: rgb(248 113 113 / 20%);
  border: 2px solid rgb(248 113 113 / 60%);
  border-radius: 50%;
}

.bomb[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .bomb {
    display: none;
  }
}
