#app {
  position: fixed;
  inset: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#hud {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  z-index: 10;
  color: #273444;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

#score {
  margin: 0;
  font-size: clamp(38px, 10vw, 52px);
  letter-spacing: 1px;
  font-weight: 800;
  line-height: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 25, 31, 0.34);
  backdrop-filter: blur(2px);
  transition: opacity 0.2s ease;
}

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

.modal-card {
  width: min(92vw, 360px);
  border-radius: 6px;
  padding: 18px;
  background: linear-gradient(160deg, #f7fbff 0%, #edf5ff 100%);
  box-shadow: 0 16px 36px rgba(34, 37, 48, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #2f3340;
}

.modal-card h2 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 34px;
  line-height: 1.05;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.modal-actions button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 11px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#btn-main {
  background: #d8dbe5;
  color: #2f3340;
}

#btn-revive {
  background: #3f8d5a;
  color: #ffffff;
}

.modal-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .modal-card {
    width: min(94vw, 360px);
    padding: 14px;
  }

  .modal-card h2 {
    font-size: 28px;
    margin-bottom: 11px;
  }

  .modal-actions button {
    min-height: 44px;
    font-size: 15px;
  }
}
