* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #05131f;
  color: #f0f9ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 1366px;
  height: 768px;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 1366 / 768;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  background: #082338;
  user-select: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

/* HUD */
#hud {
  position: absolute;
  top: 12px;
  left: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-badge {
  background: rgba(5, 19, 31, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.keybind-legend {
  align-self: flex-start;
  display: flex;
  gap: 14px;
  background: rgba(5, 19, 31, 0.72);
  border: 1px solid rgba(45, 212, 191, 0.35);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: #cbd5e1;
}

.keybind-legend strong {
  color: #5eead4;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 19, 31, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.bar-track,
.loading-track {
  width: 150px;
  height: 12px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.loading-track {
  width: 100%;
  height: 16px;
  margin-top: 12px;
}

.bar-fill,
.loading-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #14b8a6, #38bdf8);
  transition: width 0.15s ease;
}

.loading-fill {
  width: 0%;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 15, 26, 0.74);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.modal-card {
  background: #0c273d;
  border: 2px solid #2dd4bf;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 540px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}

.modal-card.wide {
  max-width: 1120px;
}

.modal-card h1 {
  font-size: 26px;
  margin-bottom: 10px;
  color: #ccfbf1;
}

.modal-card h2 {
  font-size: 23px;
  margin-bottom: 10px;
  color: #99f6e4;
}

.subtitle {
  color: #cbd5e1;
  margin-bottom: 14px;
  font-size: 15px;
}

.lake-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 15px;
}

.lake-selector select {
  background: #133957;
  color: #f0f9ff;
  border: 1px solid #38bdf8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 15px;
}

.lake-sub {
  color: #94a3b8;
  font-size: 13px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.species-card {
  background: #123552;
  border: 2px solid rgba(45, 212, 191, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  color: #f8fafc;
}

.species-card:hover {
  transform: translateY(-3px);
  border-color: #2dd4bf;
  background: #174366;
}

.species-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
  color: #5eead4;
}

.species-card p {
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.primary-btn {
  background: #0d9488;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.primary-btn:hover {
  background: #14b8a6;
  transform: translateY(-1px);
}

#feedback-banner {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 19, 31, 0.92);
  border: 1px solid #2dd4bf;
  color: #f0f9ff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
}
