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

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  overflow: hidden;
  background: linear-gradient(45deg, #2b1d2e, #1a0b1f); /* Darker, creepier base */
  transition: background 0.3s;
  color: #fff;
}

body.glitch {
  animation: bgGlitch 0.1s infinite;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  border: 4px solid #fff;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.3);
  background: #ffe6f2;
  transition: all 0.3s;
  display: none; 
}

#gameCanvas.active {
  display: block;
}

#gameCanvas.cursed {
  animation: shake 0.1s infinite;
  filter: hue-rotate(180deg) invert(1);
}

#ui {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #fff;
  font-size: 24px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 10;
  display: none;
  pointer-events: none;
}

#ui.active {
  display: block;
}

#ui.vibrate {
  animation: vibrate 0.05s infinite;
}

#fish-counter, #chaos-meter {
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #ff69b4;
  border-radius: 10px;
  display: inline-block;
}

#floating-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: bold;
  color: #ff0066;
  text-shadow: 3px 3px 0 #00ff00, -3px -3px 0 #0066ff;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  z-index: 20;
}

#floating-text.show {
  animation: floatText 2s forwards;
}

/* Start Screen Styles */
#start-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 0, 100, 0.5);
  z-index: 100;
  max-width: 600px;
  width: 90%;
  border: 6px solid #ffb3d9;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s ease;
  color: #333;
}

#start-screen.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

#start-screen h1 {
  font-size: 42px;
  color: #ff0066;
  margin-bottom: 20px;
  text-shadow: 2px 2px 0 #00ff00;
  line-height: 1.2;
}

.mascot-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
}

.mascot-head {
  width: 80px;
  height: 70px;
  background: #ffb6c1;
  border-radius: 50%;
  position: absolute;
  top: 15px;
  left: 10px;
  border: 3px solid #000;
}

.mascot-ear {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 30px solid #ffb6c1;
  position: absolute;
  top: 0;
  z-index: -1;
}

.mascot-ear.left { left: 15px; transform: rotate(-15deg); }
.mascot-ear.right { right: 15px; transform: rotate(15deg); }
.mascot-ear::after {
  content: '';
  position: absolute;
  top: 10px;
  left: -10px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid #ffc0cb;
}

.mascot-face {
  position: relative;
  top: 20px;
  width: 100%;
  height: 100%;
}

.mascot-eye {
  width: 10px;
  height: 10px;
  background: #000;
  border-radius: 50%;
  position: absolute;
  top: 10px;
  animation: blink 4s infinite;
}
.mascot-eye.left { left: 20px; }
.mascot-eye.right { right: 20px; }

.mascot-mouth {
  width: 20px;
  height: 10px;
  border-bottom: 3px solid #000;
  border-radius: 50%;
  position: absolute;
  top: 20px;
  left: 30px;
}

.mascot-blush {
  width: 10px;
  height: 5px;
  background: #ff69b4;
  border-radius: 50%;
  position: absolute;
  top: 22px;
  opacity: 0.6;
}
.mascot-blush.left { left: 10px; }
.mascot-blush.right { right: 60px; }

@keyframes blink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

.instructions {
  margin-bottom: 30px;
  color: #333;
  font-size: 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.5);
  padding: 25px;
  border-radius: 15px;
  border: 2px dashed #c9a0ff;
  width: 100%;
}

.controls-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 15px 0;
}

.control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.key {
  background: #fff;
  border: 2px solid #333;
  border-radius: 5px;
  padding: 5px 10px;
  font-family: monospace;
  font-weight: bold;
  box-shadow: 0 2px 0 #333;
  display: inline-block;
  min-width: 30px;
  text-align: center;
}

.key.wide {
  min-width: 80px;
}

.combo-hint {
  font-size: 14px;
  color: #ff0066;
  text-align: center;
  margin-top: 10px;
  background: #ffe6f2;
  padding: 5px;
  border-radius: 5px;
}

.warning {
  color: #ff0066;
  font-style: italic;
  font-size: 14px;
  margin-bottom: 20px;
  font-weight: bold;
}

#start-btn {
  font-size: 28px;
  padding: 20px 60px;
  background: #00ccff;
  color: white;
  border: 4px solid #fff;
  border-radius: 15px;
  cursor: pointer;
  font-family: 'Comic Sans MS', cursive;
  transition: all 0.3s;
  box-shadow: 0 8px 0 #0099cc, 0 15px 20px rgba(0,0,0,0.2);
  text-transform: uppercase;
  font-weight: 900;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

#start-btn:hover {
  background: #00bfff;
  transform: translateY(-4px);
  box-shadow: 0 12px 0 #0099cc, 0 20px 30px rgba(0,0,0,0.3);
}

#start-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #0099cc;
}

/* Game Over Styles */
#game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  z-index: 100;
  border: 4px solid #ff0066;
  width: 80%;
  max-width: 500px;
  color: #333;
}

#game-over.hidden {
  display: none;
}

#end-title {
  font-size: 48px;
  color: #ff0066;
  margin-bottom: 20px;
  animation: glitchText 0.3s infinite;
}

#end-message {
  font-size: 24px;
  margin-bottom: 30px;
  color: #333;
}

#restart-btn {
  font-size: 20px;
  padding: 15px 30px;
  background: #ff69b4;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Comic Sans MS', cursive;
  transition: all 0.3s;
  box-shadow: 0 5px 0 #db4c90;
}

#restart-btn:hover {
  background: #ff1493;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #db4c90;
}

#restart-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #db4c90;
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-5px, 5px) rotate(-1deg); }
  50% { transform: translate(5px, -5px) rotate(1deg); }
  75% { transform: translate(-5px, -5px) rotate(-1deg); }
}

@keyframes vibrate {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-2px, -2px); }
}

@keyframes bgGlitch {
  0% { background: linear-gradient(45deg, #2b1d2e, #1a0b1f); }
  20% { background: linear-gradient(135deg, #1a0b1f, #ff0000); }
  40% { background: linear-gradient(90deg, #0000ff, #000000); }
  60% { background: linear-gradient(45deg, #00ff00, #ff00ff); }
  80% { background: linear-gradient(180deg, #ffffff, #000000); }
  100% { background: linear-gradient(45deg, #2b1d2e, #1a0b1f); }
}

@keyframes floatText {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) rotate(-5deg);
  }
}

@keyframes glitchText {
  0%, 100% { transform: translate(0, 0); text-shadow: 3px 3px 0 #00ff00, -3px -3px 0 #0066ff; }
  25% { transform: translate(-2px, 2px); text-shadow: -3px -3px 0 #ff0000, 3px 3px 0 #00ff00; }
  50% { transform: translate(2px, -2px); text-shadow: 3px -3px 0 #0066ff, -3px 3px 0 #ff00ff; }
  75% { transform: translate(-2px, -2px); text-shadow: -3px 3px 0 #ffff00, 3px -3px 0 #ff0066; }
}
