:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111315;
  color: #f7f2e8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

img,
canvas {
  -webkit-user-drag: none;
  user-drag: none;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background: #111315;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, calc((100dvh - 174px) * 3 / 4 + 20px), 700px);
  min-height: 100dvh;
  margin: auto;
  padding: 10px;
}

header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
}

header a,
header button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #444a4e;
  border-radius: 6px;
  background: #202428;
  color: #f4ca4d;
  font: 900 14px/1 inherit;
  text-decoration: none;
}

.title {
  min-width: 0;
  text-align: center;
}

.title span {
  display: block;
  color: #65d5bb;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 1px 0 0;
  font-size: clamp(27px, 8vw, 43px);
  line-height: 0.9;
  letter-spacing: 0;
}

.stage {
  position: relative;
  height: calc(100dvh - 174px);
  min-height: 0;
  overflow: hidden;
  border: 2px solid #373d40;
  border-radius: 8px;
  background: #79cce2;
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.hud div {
  min-width: 86px;
  border: 2px solid #171c1e;
  border-radius: 6px;
  padding: 7px 11px;
  background: rgba(247, 242, 232, 0.92);
  color: #171c1e;
}

.hud span {
  display: block;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  font-size: 27px;
  line-height: 1;
}

.message {
  position: absolute;
  top: 22%;
  left: 50%;
  width: min(88%, 390px);
  border: 3px solid #171c1e;
  border-radius: 7px;
  padding: 15px;
  background: #f7f2e8;
  color: #171c1e;
  text-align: center;
  transform: translateX(-50%) rotate(-1deg);
  transition: opacity 120ms ease;
}

.message.hidden {
  opacity: 0;
  pointer-events: none;
}

.message strong,
.message span {
  display: block;
}

.message strong {
  font-size: clamp(20px, 5vw, 30px);
}

.message span {
  margin-top: 3px;
  color: #596267;
  font-size: 13px;
  font-weight: 800;
}

.action {
  touch-action: none;
  width: 100%;
  min-height: 82px;
  margin-top: 10px;
  border: 3px solid #15191b;
  border-radius: 8px;
  background: #ef6659;
  color: #15191b;
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.17);
}

.action:active,
.action.held {
  transform: translateY(2px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.17);
}

.action strong {
  display: block;
  font-size: clamp(20px, 6vw, 30px);
  line-height: 1;
}

#charge {
  display: block;
  width: min(76%, 360px);
  height: 8px;
  margin: 8px auto 0;
  overflow: hidden;
  border: 1px solid #15191b;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
}

#charge i {
  display: block;
  width: 0;
  height: 100%;
  background: #f7f2e8;
}
