* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: #111;
  color: white;
  font-family: "Press Start 2P", cursive;
}

.game {
  --game-scale: 1;
  position: relative;
  width: 1024px;
  transform: scale(var(--game-scale));
  transform-origin: center center;
}

.hud {
  position: absolute;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  padding: 20px;
  pointer-events: none;
}

.health {
  position: relative;
  width: 100%;
  border-top: 4px solid gold;
  border-bottom: 4px solid gold;
}

.health-track {
  height: 30px;
  background: red;
}

.health-player1 {
  border-left: 4px solid gold;
}

.health-player2 {
  border-right: 4px solid gold;
}

.health-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  background: #67e8f9;
}

#player1HP {
  right: 0;
}

#player2HP {
  left: 0;
}

.round-wins {
  position: absolute;
  top: 100%;
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.health-player1 .round-wins {
  left: 0;
}

.health-player2 .round-wins {
  right: 0;
  flex-direction: row-reverse;
}

.round-pip {
  width: 14px;
  height: 14px;
  background: #111;
  border: 2px solid gold;
}

.round-pip.won {
  background: gold;
}

.timer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 50px;
  background: black;
  border: 4px solid gold;
}

.announcer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 40px;
  left: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 576px;
  margin: 0;
  font-size: 22px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
  -webkit-text-stroke: 8px black;
  paint-order: stroke fill;
}

.result {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  height: 576px;
}

.result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.8);
  border: 4px solid gold;
  text-align: center;
}

.result-title {
  margin: 0;
  font-size: 20px;
}

.result-score {
  margin: 0;
  font-size: 14px;
}

.result-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.restart-button {
  padding: 12px 16px;
  color: white;
  background: black;
  border: 4px solid gold;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.restart-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

canvas {
  display: block;
  background: black;
  image-rendering: pixelated;
}

.controls {
  display: flex;
  flex-direction: column;
  width: 1024px;
  background: black;
  border: 4px solid gold;
}

.controls-players {
  display: flex;
}

.controls-card {
  width: 50%;
  padding-bottom: 14px;
}

.controls-card + .controls-card {
  border-left: 4px solid gold;
}

.controls-card h2 {
  margin: 0 0 12px;
  padding: 12px 16px;
  font-size: 12px;
}

.controls-card-player1 h2 {
  background: #155e75;
  color: #67e8f9;
}

.controls-card-player2 h2 {
  background: #991b1b;
  color: #fecaca;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 0;
  font-size: 10px;
}

.keys {
  display: flex;
  gap: 8px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  color: white;
  background: #1a1a1a;
  border: 2px solid #f5f5f5;
  border-bottom-width: 5px;
  box-shadow: 0 2px 0 #000;
  font-family: inherit;
  font-size: 10px;
}

.kbd-wide {
  min-width: 84px;
}

.controls-shared {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 12px 16px;
  border-top: 4px solid gold;
  font-size: 10px;
}

.shared-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fullscreen-button {
  padding: 10px 12px;
  color: white;
  background: black;
  border: 4px solid gold;
  font-family: inherit;
  font-size: 8px;
  cursor: pointer;
}

.fullscreen-button:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}
