* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent; 
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: none; 
}

.fullscreen-wrapper {
  position: relative;
  width: 100vw;
  height: 100dvh; 
  background: #000;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 1;
}

.interactive-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2; 
  pointer-events: none;
  overflow: hidden;
}

.paw-element {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: left, top;
  width: 50vh; 
  height: 50vh;
  max-width: 85vw;  
  max-height: 65vh; 
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0,0,0,0.6));
  z-index: 10;
}

.ghost-paw {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: left, top;
  width: 50vh; 
  height: 50vh;
  max-width: 85vw;
  max-height: 65vh;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.5));
  z-index: 80; 
  display: none;
}

.food-element {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: left, top;
  width: 14vh;
  height: 14vh;
  max-width: 25vw; 
  max-height: 25vw;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.6));
  z-index: 20; 
}

.dim-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 70; 
}

.health-container {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 100;
  pointer-events: none;
  padding-top: env(safe-area-inset-top);
}

.health-bar-container {
  width: 220px;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.health-bar-fill {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s;
}

.health-bar-fill.low-health { opacity: 0.5; }
.health-bar-fill.empty { opacity: 0; width: 0%; }

.health-text {
  color: #ffffff;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.gameover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
  pointer-events: none; 
}

.gameover-overlay.show {
  opacity: 1;
  visibility: visible;
}

.revive-btn {
  background: #222222;
  color: #ffffff;
  padding: 18px 60px;
  font-size: 1.3rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  border: 2px solid #555555;
  transition: background 0.2s, transform 0.1s;
  pointer-events: auto;
}

.revive-btn.hover {
  background: #444444;
  border-color: #ffffff;
  transform: scale(1.05);
}

.revive-progress-container {
  width: 220px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: -10px;
  pointer-events: none;
}

.revive-progress-fill {
  width: 0%;
  height: 100%;
  background: #ffffff;
  transition: width 0.1s linear;
}

.minimal-controls {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top)); 
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 12px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.25); }
.icon-btn:disabled { opacity: 0.4; pointer-events: none; }

.paw-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  color: white;
  font-size: 0.85rem;
  margin-left: 4px;
}

.paw-badge img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px;
}

.status {
  color: #ccc;
  font-size: 0.8rem;
  margin-left: 6px;
  white-space: nowrap;
}