.game-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: rgba(7, 16, 7, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.game-home-link {
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.85rem;
  font-weight: 600; padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.08); transition: background .2s, color .2s;
}
.game-home-link:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── HUD ─────────────────────────────────────────── */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 20px;
  pointer-events: none;
  z-index: 10;
  gap: 12px;
}
#hud.hidden { display: none; }

.fighter-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 190px;
}
.rat-col { align-items: flex-end; }

.fighter-name {
  font-family: 'Bungee', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
}

/* Health bar */
.hp-track {
  width: 200px;
  height: 20px;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}
.hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  transition: width 0.1s ease-out;
}

/* Frog bar: left-anchored (fills left → right) */
.frog-fill { background: linear-gradient(90deg, #2ecc71, #27ae60); }

/* Rat bar: right-anchored (fills right ← left — Street Fighter style) */
.rat-fill {
  background: linear-gradient(270deg, #e74c3c, #c0392b);
  margin-left: auto;
}

.pip-row {
  display: flex;
  gap: 5px;
  font-size: 13px;
}
.rat-pips { flex-direction: row-reverse; }

.centre-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 2px;
}
#round-label {
  font-family: 'Bungee', sans-serif;
  font-size: 14px;
  color: #f1c40f;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* ── Status flash ─────────────────────────────────── */
#status {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bungee', sans-serif;
  font-size: clamp(52px, 11vw, 108px);
  color: #fff;
  text-shadow: 5px 5px 0 #000, -3px -3px 0 rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 20;
}
#status.hidden { display: none; }
#status.pop {
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pop {
  from { transform: scale(0.3) rotateZ(-6deg); opacity: 0; }
  to   { transform: scale(1)   rotateZ(0deg);  opacity: 1; }
}

/* ── Start / Game-Over screen ─────────────────────── */
#screen {
  position: fixed;
  top: 48px;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.84);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  z-index: 30;
}
#screen.hidden { display: none; }

.screen-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  margin: auto 0;
  padding: 24px 0;
}

#screen-title {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(38px, 8vw, 78px);
  color: #f1c40f;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.55);
  line-height: 1;
}
#screen-sub {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(18px, 3.5vw, 34px);
  color: #2ecc71;
  letter-spacing: 3px;
  margin-top: -6px;
}

.controls-grid {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  color: #bbb;
  font-size: 14px;
  margin: 4px 0;
}
kbd {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: monospace;
  color: #fff;
  font-size: 13px;
}

#play-btn {
  padding: 14px 52px;
  font-family: 'Bungee', sans-serif;
  font-size: 22px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 5px 0 #7b241c;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.35);
}
#play-btn:hover:not(:disabled) {
  background: #c0392b;
  transform: translateY(2px);
  box-shadow: 0 3px 0 #6e1f18;
}
#play-btn:disabled {
  background: #555;
  box-shadow: 0 5px 0 #333;
  cursor: default;
}

#load-msg {
  color: #777;
  font-size: 13px;
  min-height: 18px;
}
