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(74, 222, 128, 0.92), rgba(20, 83, 45, 0.94));
  z-index: 20;
}

#result {
  background: rgba(21, 128, 61, 0.92);
  z-index: 40;
}

#result.lose {
  background: rgba(127, 29, 29, 0.92);
}

#battle {
  background: rgba(15, 23, 42, 0.55);
  z-index: 30;
  justify-content: flex-end;
  padding-bottom: 28px;
}

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

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

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

#catch-label {
  color: #86efac;
  font-size: 15px;
}

#team-label {
  color: #7dd3fc;
  font-size: 14px;
}

.mini {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 600;
}

.banner {
  margin-top: 6px;
  color: #facc15;
  font-size: 24px;
  font-weight: 900;
  min-height: 30px;
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  color: #bbf7d0;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(42px, 9vw, 72px);
  line-height: 0.95;
  text-shadow: 0 6px 0 #14532d;
}

.hint {
  margin: 0 0 22px;
  max-width: 34ch;
  font-size: 16px;
  line-height: 1.45;
  color: #dcfce7;
}

.footer {
  margin: 16px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 28px;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  background: #facc15;
  color: #14532d;
  box-shadow: 0 7px 0 #a16207;
}

button:hover,
button:focus-visible {
  transform: translateY(-2px);
}

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

button.ghost {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 3px #fff8;
}

.battle-panel {
  width: min(420px, 92vw);
  padding: 20px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 12px 40px #0006;
}

.battle-panel h2 {
  margin: 0 0 6px;
  color: #fde68a;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
  text-align: left;
}

.bar-wrap span {
  font-size: 13px;
  font-weight: 700;
}

.bar {
  height: 14px;
  border-radius: 999px;
  background: #334155;
  overflow: hidden;
  margin-top: 4px;
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  border-radius: inherit;
}

.log {
  min-height: 40px;
  color: #e2e8f0;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#result-title {
  font-size: clamp(36px, 8vw, 64px);
}
