@font-face {
  font-family: InkPot;
  src: url("assets/inkpot.ttf") format("truetype");
}

@font-face {
  font-family: Vijaya;
  src: url("assets/vijaya.ttf") format("truetype");
}

@font-face {
  font-family: VijayaTip;
  src: url("assets/vijaya-tip.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  font: 1rem system-ui, sans-serif;
  background: #14171c;
  color: #e8e2d5;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.player {
  width: min(100%, 770px);
  margin: clamp(0px, 5vh, 3rem) auto 0;
}

.stage {
  position: relative;
  background: #1b1f27;
  aspect-ratio: 770 / 480;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.stage-button {
  position: absolute;
  padding: 0;
  border: 0;
  color: transparent;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
}

.main-button {
  left: 47.25%;
  top: 51.25%;
  width: 20.9%;
  height: 15.2%;
  border-radius: 28%;
}

.mute-button {
  left: 1.1%;
  top: 88.1%;
  width: 6.2%;
  height: 11.1%;
  border-radius: 50%;
}

button {
  font: inherit;
  cursor: pointer;
}

.stage-button:hover {
  background: rgb(255 232 185 / 12%);
}

button:focus-visible, canvas:focus-visible {
  outline: 2px solid #ffdc91;
  outline-offset: -2px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.7rem 0.6rem;
  font-size: 0.875rem;
}

.toolbar p {
  margin: 0;
}

.level-buttons, .touch-controls {
  display: flex;
  gap: 0.5rem;
}

.level-buttons button, .touch-controls button, .online button, .dialog-actions button {
  padding: 0.35rem 0.75rem;
  color: inherit;
  background: #252a33;
  border: 1px solid #55575d;
  border-radius: 0.35rem;
}

.touch-controls {
  display: none;
  padding: 0 0.6rem 0.6rem;
}

.touch-controls button {
  min-width: 3rem;
  min-height: 3rem;
  font-size: 1.5rem;
  touch-action: none;
  user-select: none;
}

.touch-controls [data-action="jump"] {
  margin-left: auto;
}

.online {
  padding: 0 0.6rem 0.7rem;
  font-size: 0.875rem;
}

.online h2 {
  margin: 0;
  font-size: inherit;
}

.online-header, .dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.online-header {
  flex-wrap: wrap;
}

#arena-score {
  margin: 0.4rem 0;
}

.dialog-actions {
  justify-content: flex-end;
}

#username-dialog {
  box-sizing: border-box;
  width: min(22rem, calc(100% - 2rem));
  padding: 1.25rem;
  color: inherit;
  background: #1b1f27;
  border: 1px solid #6d6454;
  border-radius: 0.5rem;
}

#username-dialog::backdrop {
  background: rgb(0 0 0 / 65%);
}

#username-form {
  display: grid;
  gap: 0.65rem;
}

#username-form h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

#username {
  min-width: 0;
  padding: 0.5rem;
  color: inherit;
  background: #14171c;
  border: 1px solid #777;
  border-radius: 0.35rem;
  font: inherit;
}

.online ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.online li {
  border-inline-start: 0.35rem solid var(--player-color);
  padding-inline-start: 0.35rem;
}

@media (pointer: coarse), (any-pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
