@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes pop-in {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

body {
  background: #0b0b0f;
  color: #e8e8e8;
  font-family: "Courier New", monospace;
  text-align: center;
  margin: 0;
  padding: 24px;
  background-image: radial-gradient(circle at 50% 0%, #1a1330 0%, #0b0b0f 70%);
}

h1 {
  letter-spacing: 0.25em;
  margin-bottom: 16px;
  color: #3ddc3d;
  text-shadow: 0 0 6px #3ddc3d99, 0 0 18px #3ddc3d44;
}

#setup input {
  width: 70px;
  margin: 0 8px;
  background: #1a1a22;
  color: #fff;
  border: 1px solid #444;
  padding: 4px;
  font-family: inherit;
}

#setup button {
  margin-left: 16px;
  padding: 6px 18px;
  background: #3ddc3d;
  color: #0b0b0f;
  border: none;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 0.1em;
  box-shadow: 0 0 0 2px #0b0b0f, 0 0 12px #3ddc3d88;
  transition: transform 0.1s ease-out;
}

#setup button:hover {
  transform: scale(1.05);
}

#setup button:disabled {
  background: #444;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.hidden {
  display: none !important;
}

#arena {
  max-width: 800px;
  margin: 16px auto;
  position: relative;
}

.hud {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.healthbar,
.powerbar {
  height: 16px;
  background: #161620;
  border: 2px solid #555;
  box-shadow: inset 0 0 0 1px #000;
}

.powerbar {
  height: 8px;
}

.health-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(#5cf25c, #2fae2f);
  transition: width 0.15s ease-out;
}

.power-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(#ffe066, #d9a300);
  transition: width 0.1s linear;
}

.power-fill.power-ready {
  animation: pulse 0.5s infinite;
  box-shadow: 0 0 8px #ffd700, 0 0 16px #ffd700aa;
}

#p1-health,
#p1-power {
  margin-left: auto;
}

#timer {
  width: 44px;
  font-size: 22px;
  color: #ffe066;
  text-shadow: 0 0 6px #ffe06699;
}

.names {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

canvas {
  background: #1b1330;
  border: 2px solid #444;
  box-shadow: 0 0 0 4px #0b0b0f, 0 0 24px #3ddc3d22;
  image-rendering: pixelated;
  width: 100%;
  display: block;
}

.taunt {
  position: absolute;
  top: 40px;
  background: #fff;
  color: #000;
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 220px;
  font-size: 12px;
  box-shadow: 0 2px 10px #0008;
}

#taunt-p1 {
  left: 20px;
}

#taunt-p2 {
  right: 20px;
}

#result {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  padding: 12px 28px;
  border: 2px solid #ffe066;
  box-shadow: 0 0 20px #ffe06666;
  animation: pop-in 0.35s ease-out;
  max-width: 420px;
  text-align: center;
}

#result-title {
  font-size: 32px;
  letter-spacing: 0.1em;
}

#result-quote {
  font-size: 13px;
  font-style: italic;
  opacity: 0.75;
  margin-top: 8px;
  letter-spacing: normal;
}

.controls {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 8px;
}
