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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #3ec1d3 0%, #6db1f0 55%, #a8e063 100%);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  padding: 16px;
  -webkit-user-select: none;
  user-select: none;
}

.frame {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  font-size: 15px;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-item b {
  color: #e8590c;
}

.icon-btn {
  border: none;
  background: #e9ecef;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.icon-btn:hover { background: #dee2e6; }
.icon-btn:active { transform: scale(0.9); }

/* ---------- Canvas ---------- */
.canvas-wrap {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  background: #e6f7ff;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

/* ---------- Player (DOM, gleiche Schrift wie Tier-Auswahl) ---------- */
.player {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  line-height: 1;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(3px);
  z-index: 5;
}

.overlay.hidden { display: none; }

.panel {
  background: #ffffff;
  border-radius: 22px;
  padding: 26px 30px;
  width: min(560px, 88%);
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  animation: pop 0.28s ease;
}

@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.panel h1 {
  font-size: 30px;
  color: #1c3d5a;
  margin-bottom: 6px;
}

.panel .sub {
  color: #6b7280;
  font-size: 15px;
  margin-bottom: 14px;
}

.panel .hint {
  margin-top: 16px;
  color: #6b7280;
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- Animal picker ---------- */
.picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.animal-btn {
  border: 2px solid transparent;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 12px 6px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.animal-btn:hover {
  transform: translateY(-3px);
  border-color: #ffa94d;
  background: #fff4e6;
}

.animal-btn:active { transform: scale(0.95); }

.animal-emoji {
  font-size: 44px;
  animation: floaty 2.2s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.animal-name {
  font-size: 13px;
  color: #374151;
  font-weight: 600;
}

/* ---------- Game over ---------- */
.final-score {
  font-size: 22px;
  color: #1c3d5a;
  margin: 8px 0 4px;
}

.final-score b { font-size: 30px; color: #e8590c; }

.result {
  color: #16a34a;
  font-weight: 700;
  font-size: 17px;
  min-height: 24px;
  margin-bottom: 14px;
}

.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: #4dabf7;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.96); }

.btn.primary { background: #ff922b; }

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  font-size: 14px;
}