body {
  margin: 0;
  font-family: "Press Start 2P", cursive, system-ui, sans-serif;
  font-size: clamp(0.85rem, 2.8vw, 1.25rem);
  color: white;
  overflow: hidden;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.55rem;
}

.back-link {
  color: #fff;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.lang-switch button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 0.65rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-switch button.active {
  background: rgba(255, 255, 255, 0.25);
}

.crossy-hint {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  left: 16px;
  right: 16px;
  z-index: 14;
  margin: 0;
  text-align: center;
  font-size: 0.45rem;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.hud {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  left: 16px;
  right: 16px;
  z-index: 15;
  display: flex;
  gap: 12px;
  font-size: 0.55rem;
  pointer-events: none;
}

.hud-pill {
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.hud-pill.best {
  margin-left: auto;
  color: #ffd93d;
}

button {
  outline: none;
  cursor: pointer;
  border: none;
  box-shadow: 3px 5px 0px 0px rgba(0, 0, 0, 0.75);
}

#end {
  position: absolute;
  min-width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  visibility: hidden;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
}

#end p {
  margin: 0;
  font-size: 0.7rem;
}

#end button {
  background-color: red;
  padding: 20px 50px;
  font-family: inherit;
  font-size: inherit;
}

#controlls {
  position: absolute;
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 12;
}

#controlls div {
  display: grid;
  grid-template-columns: 80px 80px 80px;
  grid-template-rows: auto auto;
  grid-column-gap: 14px;
  grid-row-gap: 14px;
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  pointer-events: auto;
}

canvas {
  touch-action: manipulation;
}

canvas.touch-play-active {
  touch-action: none;
}

#controlls button {
  width: 100%;
  min-height: 72px;
  background-color: white;
  border: 2px solid lightgray;
  border-radius: 12px;
}

#controlls button:first-of-type {
  grid-column: 1/-1;
  min-height: 64px;
}

@media (max-width: 480px) {
  #controlls div {
    grid-template-columns: 88px 88px 88px;
    grid-column-gap: 16px;
  }

  #controlls button {
    min-height: 80px;
  }
}
