:root {
  --bg: #0f1420;
  --panel: #182236;
  --gator: #57c84d;
  --croc: #b07a3c;
  --fish: #ff9f1c;
  --text: #e8eef7;
  --muted: #8a97ab;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  user-select: none;
}

#board {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  background: #0d3b66;
}

/* ---- HUD: sharp square tiles, top-left ---- */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  gap: 4px;
  z-index: 5;
}

#hud-right {
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
  z-index: 5;
}

/* BEST: sits next to SCORE in 1P, centered on screen in 2P */
#hud-best {
  position: fixed;
  top: 0;
  left: 100px;
  z-index: 5;
}
body.two-player #hud-best {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Crocodile (Player 2) score only shows in 2-player mode */
body:not(.two-player) #hud-right {
  display: none;
}

.label-sm {
  font-size: 10px !important;
  letter-spacing: 1px !important;
}

.hud-square {
  width: 96px;
  height: 96px;
  background: var(--panel);
  border: 2px solid #263450;
  border-radius: 0;              /* sharp edges */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* SCORE, BEST and CROCODILE tiles are all green */
#hud .hud-square,
#hud-best .hud-square,
#hud-right .hud-square {
  background: #2e7d32;
  border-color: #1f5e26;
}

.hud-square .label {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
}

.hud-square span:last-child {
  font-size: 40px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 4px;
}

/* ---- Overlays ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.9);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  gap: 16px;
  z-index: 10;
}

/* Start screen uses the title image; death screen uses the death image */
#start-screen {
  background: #005a2a url("Title Screen.png") center / cover no-repeat;
  backdrop-filter: none;
  justify-content: flex-start;
  padding-top: 7vh;
}
#over-screen {
  background: #005a2a url("death screen.png") center / cover no-repeat;
  backdrop-filter: none;
}

.menu {
  display: flex;
  gap: 20px;
}

/* 1P / 2P buttons: blue, sitting in the green area up top */
.menu .btn {
  background: #1e90ff;
  box-shadow: 0 5px 0 #155fa8;
  color: #06253f;
}
.menu .btn:hover { background: #47a6ff; }
.menu .btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #155fa8; }

/* Death text sits in a panel so it stays readable over the image */
.over-panel {
  position: relative;
  z-index: 2;
  background: rgba(10, 15, 25, 0.82);
  border: 2px solid #263450;
  padding: 30px 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.overlay.hidden,
#pause-badge.hidden { display: none; }

h1 {
  margin: 0;
  font-size: 56px;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.vs { color: var(--fish); font-style: italic; }
.gator-txt { color: var(--gator); }
.croc-txt { color: var(--croc); }
.fish-ico { color: var(--fish); }

.tagline { margin: 0; color: var(--muted); font-size: 16px; }

.rules {
  text-align: left;
  margin: 6px 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  max-width: 380px;
}

.btn {
  margin-top: 8px;
  padding: 14px 40px;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #0f1420;
  background: var(--gator);
  border: none;
  border-radius: 0;              /* sharp, to match the HUD */
  cursor: pointer;
  box-shadow: 0 5px 0 #2e7d32;
  transition: transform 0.05s, box-shadow 0.05s;
}

.btn:hover { background: #6ad85f; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #2e7d32; }

/* 2-player button, croc-themed */
.btn-alt { background: var(--croc); box-shadow: 0 5px 0 #6b4a20; }
.btn-alt:hover { background: #c98f4f; }
.btn-alt:active { transform: translateY(4px); box-shadow: 0 1px 0 #6b4a20; }

.final-stats {
  display: flex;
  gap: 40px;
  margin: 8px 0;
}

.final-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-stats span:last-child {
  font-size: 34px;
  font-weight: bold;
}

#pause-badge {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  font-weight: bold;
  letter-spacing: 6px;
  color: var(--text);
  background: rgba(10, 15, 25, 0.7);
  padding: 14px 30px;
  z-index: 6;
}

#foot {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  z-index: 5;
}
