* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Trebuchet MS', 'Comic Sans MS', 'Segoe UI', sans-serif;
  user-select: none;
}

body {
  background: linear-gradient(180deg, #bde0fe 0%, #e0fbfc 55%, #f1faee 100%);
  color: #1d3557;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.top-bar-nav {
  width: 100%;
  max-width: 940px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.btn-back {
  background: #ffd166;
  color: #1d3557;
  text-decoration: none;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 999px;
  border: 3px solid #1d3557;
  box-shadow: 0 3px 0 #1d3557;
  font-size: 13px;
}

.top-tag {
  background: rgba(255, 255, 255, 0.9);
  border: 2.5px solid #2b4c7e;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #2b4c7e;
}

.game-container {
  position: relative;
  width: 100%;
  max-width: 940px;
  background: #f8fdff;
  border: 4px solid #1d3557;
  border-radius: 26px;
  box-shadow: 0 10px 0 #90e0ef, 0 18px 30px rgba(29, 53, 87, 0.16);
  overflow: hidden;
}

.hud {
  background: linear-gradient(180deg, #e0fbfc, #caf0f8);
  border-bottom: 3.5px solid #1d3557;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-box {
  background: #ffffff;
  border: 2.5px solid #2b4c7e;
  border-radius: 16px;
  padding: 6px 14px;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 3px 0 #90e0ef;
}

.hud-box span {
  display: block;
  font-size: 10px;
  font-weight: 900;
  color: #457b9d;
  letter-spacing: 0.7px;
}

.hud-box strong {
  font-size: 18px;
  color: #1d3557;
}

#btn-pause,
.btn-primary {
  background: linear-gradient(180deg, #ffb703, #fb8500);
  color: #ffffff;
  border: 3px solid #1d3557;
  border-radius: 14px;
  padding: 9px 16px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 0 #1d3557;
}

#btn-pause:active,
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1d3557;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(29, 53, 87, 0.52);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 16px;
}

.overlay.hidden {
  display: none;
}

.modal {
  background: #ffffff;
  color: #1d3557;
  border: 4px solid #1d3557;
  border-radius: 26px;
  padding: 26px 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 0 #90e0ef;
}

.modal h1,
.modal h2 {
  color: #0077b6;
  margin-bottom: 12px;
  font-size: 25px;
}

.modal p {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 20px;
  color: #3d5a80;
}
