/* Polish Patrol - Main Stylesheet */

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

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Game Container */
.game-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 90vh;
  max-height: 900px;
  background-color: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Make game container square on desktop */
@media (min-width: 768px) {
  .game-container {
    width: min(80vh, 800px);
    height: min(80vh, 800px);
    aspect-ratio: 1 / 1;
  }
}

/* Orientation message */
.orientation-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.orientation-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.phone-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.rotate-icon {
  font-size: 40px;
  animation: rotate 2s infinite linear;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(90deg); }
}

/* Make adjustments for mobile */
@media (max-width: 767px) {
  .game-container {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    padding: 0;
  }
  
  /* Landscape specific styles */
  @media (orientation: landscape) {
    .game-container {
      height: 100vh;
      max-width: none;
    }
    
    #game-canvas {
      max-height: 100vh;
      width: auto;
      height: 100%;
    }
  }
  
  h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }
  
  h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }
  
  .button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    margin: 0.4rem;
  }
  
  .title-content {
    padding: 1rem;
  }
  
  .tagline {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .game-header {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Screens */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  z-index: 1000; /* Ensure it's on top of everything */
}

/* Title Screen */
#title-screen {
  background: linear-gradient(135deg, #ff3366 0%, #ff6b6b 100%);
}

.title-content {
  text-align: center;
  padding: 2rem;
  color: white;
  position: relative;
}

.title-content h1 {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

.tagline {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.sound-toggle {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

/* Leaderboard Styles */
.leaderboard-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  padding: 20px;
  width: 80%;
  max-width: 500px;
  max-height: 80%;
  overflow-y: auto;
  z-index: 1000;
  color: white;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Quick Guide Inline Styles */
.quick-guide-inline {
  margin-top: 20px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  color: white;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.quick-guide-inline h3 {
  margin-top: 0;
  color: #FF69B4;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.guide-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.guide-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  margin-bottom: 5px;
}

.guide-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 5px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

.guide-item p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.2;
}

.guide-controls {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 10px;
  font-size: 0.8rem;
}

.guide-controls p {
  margin: 5px 0;
}

/* Game element icons using SVG representations */
.guide-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
}

/* Cotton pad - white circle */
.cotton-pad-icon {
  background-color: #EFEFEF;
  border: 2px solid #E0E0E0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.cotton-pad-icon::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  top: 25%;
  left: 25%;
}

/* Polish bottle - ORLY bottle shape */
.polish-bottle-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23FF3366' d='M40,20 L60,20 L65,30 L65,80 C65,85 60,90 50,90 C40,90 35,85 35,80 L35,30 Z'/%3E%3Crect fill='%23000' x='40' y='10' width='20' height='10'/%3E%3C/svg%3E");
}

/* Acetone station - blue circle with X */
.acetone-icon {
  background-color: #33CCFF;
  position: relative;
}

.acetone-icon::before, .acetone-icon::after {
  content: '';
  position: absolute;
  background-color: white;
  width: 50%;
  height: 3px;
  top: 50%;
  left: 25%;
}

.acetone-icon::before {
  transform: translateY(-50%) rotate(45deg);
}

.acetone-icon::after {
  transform: translateY(-50%) rotate(-45deg);
}

/* Acetone pearl - glowing blue dot */
.pearl-icon {
  background-color: #33CCFF;
  box-shadow: 0 0 10px #33CCFF, 0 0 15px white;
  position: relative;
}

.pearl-icon::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  background-color: white;
  border-radius: 50%;
  top: 20%;
  left: 20%;
}

.leaderboard-container h3 {
  color: #ff3366;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-align: center;
}

.leaderboard-loading {
  text-align: center;
  font-style: italic;
  color: #777;
  margin: 1rem 0;
}

.leaderboard-list {
  list-style-type: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.leaderboard-list li {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-list li:nth-child(1) {
  background-color: rgba(255, 215, 0, 0.2);
  font-weight: bold;
}

.leaderboard-list li:nth-child(2) {
  background-color: rgba(192, 192, 192, 0.2);
}

.leaderboard-list li:nth-child(3) {
  background-color: rgba(205, 127, 50, 0.2);
}

.leaderboard-list .player-rank {
  font-weight: bold;
  margin-right: 0.5rem;
}

.leaderboard-list .player-name {
  flex-grow: 1;
  text-align: left;
}

.leaderboard-list .player-score {
  font-weight: bold;
  color: #ff3366;
}

.leaderboard-list .player-level {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #777;
}

#leaderboard-close {
  display: block;
  margin: 0 auto;
  background-color: #ff3366;
  border: none;
  padding: 12px 24px;
  margin: 10px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
}

/* Buttons */
.button {
  background: linear-gradient(135deg, #ff3366 0%, #ff66cc 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  margin: 10px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(255, 51, 102, 0.3);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 51, 102, 0.4);
}

.button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(255, 51, 102, 0.4);
}

.small-button {
  padding: 8px 16px;
  font-size: 0.8rem;
}

/* Sound Toggle */
.sound-toggle {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* Instructions Screen */
.instructions-content {
  max-width: 800px;
  width: 90%;
  margin: 0 auto;
  padding: 1.5rem;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.instruction-section {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 1rem;
}

.instruction-section h3 {
  color: #ff3366;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .instruction-grid {
    grid-template-columns: 1fr;
  }
  
  .instruction-section h3 {
    font-size: 1.1rem;
  }
  
  .instruction-item {
    padding: 0.8rem;
  }
  
  .instruction-item p {
    font-size: 0.85rem;
  }
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  text-align: left;
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.instruction-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.instruction-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
  flex-shrink: 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.instruction-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.instruction-item p strong {
  color: #333;
  display: block;
  margin-bottom: 0.3rem;
}

.mobile-controls-info {
  background-color: #f0f8ff;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.touch-demo {
  width: 100px;
  height: 100px;
  margin: 1rem auto;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 1a11 11 0 0 1 11 11c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1zm0 20a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm0-16a7 7 0 0 1 7 7 1 1 0 1 1-2 0 5 5 0 0 0-5-5 1 1 0 1 1 0-2zm0 5a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  position: relative;
}

.touch-demo::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 51, 102, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-demo 1.5s infinite alternate;
}

@keyframes pulse-demo {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.3; }
}

/* Game Screen */
#game-screen {
  flex-direction: column;
  justify-content: flex-start;
  background-color: #f0f0f0;
  display: flex;
  align-items: center; /* Center horizontally */
}

.game-header {
  width: 100%;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.canvas-container {
  width: min(calc(100% - 20px), calc(100vh - 100px));
  height: min(calc(100% - 80px), calc(100vw - 20px));
  aspect-ratio: 1 / 1;
  margin: 10px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
}

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

/* Score and Lives */
.score-container, .level-container, .lives-container {
  display: flex;
  align-items: center;
}

#lives-display {
  display: flex;
  margin-left: 5px;
}

.life-icon {
  width: 20px;
  height: 20px;
  background-color: #ff3366;
  border-radius: 50%;
  margin-right: 5px;
}

/* Game Gauges */
#gauges-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 10px;
}

.gauge-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.gauge-wrapper span {
  font-size: 0.8rem;
  width: 120px;
  text-align: right;
  margin-left: 8px;
}

.meter {
  width: 100px;
  height: 12px;
  background-color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

#saturation-fill {
  background: linear-gradient(90deg, #ffffff 0%, #ff3366 100%);
}

#cleanup-fill {
  background: linear-gradient(90deg, #33ccff 0%, #33cc99 100%);
}

/* Mobile Controls */
#mobile-controls {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 50;
}

.touch-hint {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 8px 15px;
  display: inline-block;
  animation: fade-in-out 3s forwards;
}

.hint-text {
  color: white;
  font-size: 16px;
  font-weight: bold;
}

@keyframes fade-in-out {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Pause Screen */
#pause-screen {
  background-color: rgba(0, 0, 0, 0.7);
}

.pause-content {
  background-color: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Game Over Screen */
#game-over-screen {
  background-color: rgba(0, 0, 0, 0.8);
}

.game-over-content {
  background-color: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-over-content h2 {
  color: #ff3366;
  margin-bottom: 1rem;
}

/* High Score Styles */
.high-score-form {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.high-score-form h3 {
  color: #f39c12;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

#player-name {
  padding: 0.5rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-family: 'Quicksand', sans-serif;
  margin-bottom: 0.5rem;
  width: 80%;
  max-width: 250px;
}

.high-scores-display {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.high-scores-display h3 {
  color: #3498db;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

#high-scores-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  text-align: left;
  max-height: 150px;
  overflow-y: auto;
}

#high-scores-list li {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

#high-scores-list li:nth-child(1) {
  font-weight: bold;
  color: #f39c12;
  font-size: 1.1rem;
}

#high-scores-list li:nth-child(2) {
  font-weight: bold;
  color: #7f8c8d;
}

#high-scores-list li:nth-child(3) {
  font-weight: bold;
  color: #cd7f32;
}

#high-score-loading {
  font-style: italic;
  color: #7f8c8d;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Level Complete Screen */
#level-complete-screen {
  background-color: rgba(255, 51, 102, 0.9);
  z-index: 2000 !important; /* Force it to be on top */
}

.level-complete-content {
  background-color: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  max-width: 80%;
}

.level-complete-content h2 {
  color: #33cc99;
  margin-bottom: 1rem;
}

/* Shades Grid */
.shades-container {
  margin: 20px 0;
}

#shades-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.shade-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
}

.shade-color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.shade-name {
  font-size: 0.8rem;
  text-align: center;
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Ensure it's above everything else */
  transition: opacity 0.5s ease;
}

.loading-content {
  text-align: center;
  padding: 20px;
}

.loading-content h2 {
  color: #ff3366;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

@media (max-width: 480px) {
  .loading-content h2 {
    font-size: 1.5rem;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
  }
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #ff3366;
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 3rem;
  }
  
  .game-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  #mobile-controls {
    display: block;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.5rem;
  }
  
  .button {
    padding: 10px 20px;
  }
  
  .instructions-content, 
  .pause-content, 
  .game-over-content, 
  .level-complete-content {
    max-width: 90%;
    padding: 1.5rem;
  }
}

/* Game-specific styling for instruction icons */
.cotton-pad-icon {
  background-color: #ffffff;
  position: relative;
  border: 2px solid #f0f0f0;
}

.cotton-pad-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, #ffffff 0%, #f0f0f0 100%);
  border-radius: 50%;
}

.bottle-icon {
  background-color: #ff66cc;
  position: relative;
}

.bottle-icon::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 20%;
  background-color: #dddddd;
  border-radius: 3px;
}

.saturation-icon {
  background: linear-gradient(135deg, #ffffff 0%, #ff66cc 100%);
  position: relative;
}

.saturation-icon::after {
  content: '!';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.cleanup-icon {
  background-color: #66ccff;
  position: relative;
}

.cleanup-icon::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.safe-icon {
  background-color: #99cc99;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.item-icon {
  background-color: #ffcc66;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.power-icon {
  background-color: #33ccff;
  position: relative;
}

.power-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

/* Acetone Hint */
.acetone-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(51, 204, 255, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px rgba(51, 204, 255, 0.6);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Level Up Indicator */
.level-up-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 51, 102, 0.9);
  color: white;
  padding: 15px 30px;
  border-radius: 20px;
  font-size: 36px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.8), 0 0 40px rgba(255, 255, 255, 0.6);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  animation: pulse 1s infinite alternate;
}

/* Saturation Warning */
.saturation-warning {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 15px;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
  z-index: 100;
  opacity: 0; /* Hidden by default */
  pointer-events: none;
  animation: flash 0.8s infinite alternate;
  display: none; /* Initially hidden */
  transition: opacity 0.8s ease; /* Smooth transition for opacity */
}

@keyframes flash {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* Acetone Feedback Message */
.acetone-feedback {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(51, 204, 255, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 15px;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 15px rgba(51, 204, 255, 0.7);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  display: none;
}

@keyframes pulse {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.1); }
}

/* Floating text for points */
.floating-text {
  position: absolute;
  font-size: 20px;
  font-weight: bold;
  color: #FFFFFF;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 100;
  animation: float-up 1s ease-out forwards;
}

/* Bonus text for completing objectives */
.bonus-text {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 165, 0, 0.8);
  color: white;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  z-index: 100;
  animation: pulse 0.5s infinite alternate, fade-out 2s forwards;
}

/* Lost item message */
.item-lost-message {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 51, 51, 0.85);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
}

.item-lost-message.show {
  opacity: 1;
}

.item-icon {
  font-size: 24px;
  margin-right: 5px;
  vertical-align: middle;
}

.points-lost {
  color: #FFD700;
  font-weight: bold;
}

/* Item counter display */
.item-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
}

/* Touch indicator */
.touch-indicator {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.touch-indicator.active {
  opacity: 1;
  animation: pulse-touch 0.5s infinite alternate;
}

@keyframes pulse-touch {
  0% { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1.2); }
}

.item-counter-icon {
  font-size: 24px;
}

/* Animations */
@keyframes float-up {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-50px);
    opacity: 0;
  }
}

@keyframes fade-out {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
