html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: #14532d;
}

#renderCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  z-index: 10;
  pointer-events: auto;
}

.overlay.hidden {
  display: none;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

#menu {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.92), rgba(22, 101, 52, 0.9));
  z-index: 20;
}

#result {
  background: rgba(22, 101, 52, 0.92);
  z-index: 30;
}

#result.lose {
  background: rgba(153, 27, 27, 0.92);
}

#hud {
  justify-content: flex-start;
  align-items: flex-start;
  pointer-events: none;
  z-index: 15;
}

.hud-box {
  margin: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-weight: 700;
  text-shadow: 0 2px 0 #000;
}

#level-label {
  color: #fde68a;
  font-size: 18px;
}

#phase-label {
  color: #7dd3fc;
  font-size: 16px;
}

#found-label,
#time-label,
#score-label {
  font-size: 16px;
}

#time-label {
  color: #bbf7d0;
}

.banner {
  margin-top: 8px;
  color: #fde68a;
  font-size: 28px;
  font-weight: 900;
  min-height: 34px;
}

body.inside-house #hud .hud-box {
  background: rgba(67, 20, 7, 0.82);
  border: 2px solid #fbbf24;
}

body.inside-house::after {
  content: "CASA";
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 16;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 28px;
  color: #fde68a;
  text-shadow: 0 3px 0 #7c2d12;
  pointer-events: none;
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 8vw, 64px);
  line-height: 1;
  text-shadow: 0 4px 0 #0f172a;
}

.hint,
.footer {
  margin: 10px 0;
  font-size: 18px;
  color: #e2e8f0;
  line-height: 1.45;
}

.footer {
  font-size: 14px;
  opacity: 0.85;
}

button {
  margin-top: 12px;
  padding: 14px 36px;
  border: none;
  border-radius: 16px;
  background: #f97316;
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 0 #7c2d12;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #7c2d12;
}

#btn-next {
  background: #facc15;
  color: #14532d;
  box-shadow: 0 8px 0 #a16207;
}

#btn-next:active {
  box-shadow: 0 4px 0 #a16207;
}

button.ghost {
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  text-decoration: underline;
  margin-top: 8px;
}

button.ghost:active {
  transform: none;
}
