html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0f0a;
  color: #f4ecd8;
  font-family: system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-weight: 800;
  text-shadow: 0 2px 0 #000a;
}

.hud-top {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 20px;
}

.hud-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-mute {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: #f4ecd8;
  background: #0008;
  border: 2px solid #f4ecd8aa;
  border-radius: 10px;
}

.hud-hearts {
  color: #ff5a4a;
  letter-spacing: 2px;
}

.hud-bottom {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
}

.hud-ammo {
  color: #ffd26a;
  padding: 6px 10px;
  background: #0008;
  border-radius: 8px;
}

.hud-ammo.empty {
  color: #ff5a4a;
}

.hud-hint {
  position: absolute;
  left: 16px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 44px);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.6;
}


.hud-say {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 96px);
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 8px;
  background: #000a;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.hud-reload {
  position: absolute;
  right: 16px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 44px);
  pointer-events: auto;
  padding: 14px 18px;
  font: inherit;
  font-size: 15px;
  color: #1a1208;
  background: #ffd26a;
  border: 0;
  border-radius: 12px;
}

.hud-cross {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #0009;
}

.hud-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #ff3a2a;
  border-radius: 50%;
}

.hud-hurt {
  position: absolute;
  inset: 0;
  opacity: 0;
  box-shadow: inset 0 0 120px 40px #c0140a;
}

.hud-banner {
  position: absolute;
  top: 22%;
  left: 16px;
  right: 16px;
  text-align: center;
  font-size: 34px;
  opacity: 0;
}

.hud-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  background: #000b;
  pointer-events: auto;
  text-align: center;
}

.hud-end[hidden] {
  display: none;
}

.hud-end-title {
  font-size: 30px;
}

.hud-end-rank {
  font-size: 96px;
  color: #ffd26a;
  line-height: 1;
}

.hud-end-line {
  font-size: 16px;
  font-weight: 600;
}

.hud-again {
  padding: 14px 22px;
  font: inherit;
  font-size: 18px;
  color: #1a1208;
  background: #ffd26a;
  border: 0;
  border-radius: 12px;
}

#hud [hidden] {
  display: none;
}

.hud-boss {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 52px);
  left: 50%;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  text-align: center;
}



@media (orientation: landscape) and (max-height: 500px) {
  .hud-boss {
    top: max(12px, env(safe-area-inset-top));
    width: min(340px, calc(100% - 480px));
    gap: 4px;
  }
}

.hud-boss-track {
  height: 10px;
  background: #0009;
  border-radius: 5px;
  overflow: hidden;
}

.hud-boss-bar {
  height: 100%;
  width: 100%;
  background: #ff5a4a;
}

.hud-duck {
  position: absolute;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px);
  transform: translateX(-50%);
  padding: 6px 12px;
  font-size: 13px;
  background: #0008;
  border-radius: 8px;
}

.hud-skip {
  position: absolute;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  pointer-events: auto;
  padding: 12px 18px;
  font: inherit;
  font-size: 15px;
  color: #f4ecd8;
  background: #0009;
  border: 2px solid #f4ecd8;
  border-radius: 12px;
}

.hud-end-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 600px) {
  .hud-banner {
    font-size: 22px;
  }
}


.hud-board {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 52px);
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: #0007;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  max-width: 45%;
}

.hud-board.low {
  top: calc(max(16px, env(safe-area-inset-top)) + 108px);
}

.hud-board[hidden],
.hud-confetti[hidden] {
  display: none;
}

.hud-board-row {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-board-row.me {
  color: #ffd26a;
}

.hud-confetti {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
}

.hud-confetti.own {
  color: #ffd26a;
}

.hud-end-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 12px 16px;
  font-size: 16px;
  background: #0006;
  border-radius: 8px;
}


.lobby {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: auto;
  background: #0b0f0ae6;
  border: 2px solid #f4ecd8;
  border-radius: 16px;
  text-shadow: none;
}

.lobby-title {
  margin: 0;
  font-size: 24px;
  text-align: center;
}

.lobby-form,
.lobby-room {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-input,
.lobby-btn {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font: inherit;
  font-size: 17px;
  border-radius: 12px;
}

.lobby-input {
  color: #f4ecd8;
  background: #000a;
  border: 2px solid #f4ecd880;
}

.lobby-code-in {
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
}

.lobby-btn {
  color: #0b0f0a;
  background: #ffd26a;
  border: 0;
}

.lobby-btn:disabled {
  opacity: 0.5;
}

.lobby-or,
.lobby-label,
.lobby-wait,
.lobby-privacy {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0.8;
}

.lobby-code {
  font-size: 40px;
  letter-spacing: 8px;
  text-align: center;
  color: #ffd26a;
}

.lobby-players {
  margin: 0;
  padding: 12px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0007;
  border-radius: 12px;
}

.lobby-msg {
  text-align: center;
  color: #ff8a7a;
}

.lobby-msg:empty {
  display: none;
}



.title {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px;
  box-sizing: border-box;
  background: linear-gradient(#0b0f0ab3, #0b0f0a59 45%, #0b0f0acc);
}

.title-name {
  margin: 0;
  max-width: 100%;
  font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
  font-size: clamp(60px, 19vw, 132px);
  font-weight: 900;
  font-style: italic;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
  color: #f4ecd8;
  text-shadow:
    4px 4px 0 #b3361d,
    8px 8px 0 #0b0f0a;
  transform: rotate(-3deg);
}

.title-tape {
  width: min(100%, 640px);
  padding: 12px;
  box-sizing: border-box;
  background: repeating-linear-gradient(-45deg, #ffc21a 0 22px, #15130c 22px 44px);
  clip-path: polygon(0 0, 78% 0, 81% 9%, 84% 0, 87% 12%, 90% 2%, 93% 18%, 96% 10%, 100% 30%, 100% 100%, 0 100%);
  transform: rotate(-1.5deg);
}

.title-start {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 8px 16px;
  border: 0;
  background: #e8591c;
  color: #15130c;
  font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
  font-size: clamp(60px, 20vw, 104px);
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1;
  -webkit-text-stroke: 1.5px #15130c;
  clip-path: polygon(0 0, 78% 0, 81% 9%, 84% 0, 87% 12%, 90% 2%, 93% 18%, 96% 10%, 100% 30%, 100% 100%, 0 100%);
  cursor: pointer;
  touch-action: manipulation;
}

.title-start:active,
.title-start:focus-visible {
  background: #ff7a33;
  outline: none;
}

@media (min-width: 800px) {
  .title-start {
    min-height: 144px;
  }
}



.title-goal,
.title-prizes {
  margin: 0;
  max-width: 100%;
  padding: 8px 16px;
  box-sizing: border-box;
  font-family: Impact, Haettenschweiler, "Arial Black", system-ui, sans-serif;
  font-weight: 900;
  text-align: center;
  color: #f4ecd8;
  background: #15130cd9;
  border-radius: 8px;
}

.title-goal {
  font-size: clamp(20px, 6vw, 30px);
  color: #ffc21a;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.title-prizes {
  font-size: 18px;
}


.hud-end-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.hud-end-best {
  font-size: 24px;
  color: #ffd26a;
  text-transform: uppercase;
}

.hud-end-prize {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  font-size: 18px;
}

.hud-end-tag {
  padding: 2px 8px;
  color: #1a1208;
  background: #ffd26a;
  border-radius: 6px;
}

.hud-end-prize.next .hud-end-tag {
  color: #f4ecd8;
  background: #ffffff26;
}

.hud-end-how {
  flex-basis: 100%;
  font-size: 15px;
  font-weight: 600;
}

.hud-end-help {
  font-size: 16px;
  font-weight: 600;
  color: #ffb08a;
}

.hud-end-goal {
  font-size: 20px;
  color: #ffc21a;
  text-transform: uppercase;
}
