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

body, html{
  font-family: 'Comfortaa', monospace, sans-serif;
  background: linear-gradient(to bottom, #fff1f5, #f6f8f3);
  color: #3a5a40;
  text-align: center;
  overflow-x: hidden;
  user-select: none;
  height: 100%;
}

button {
  font-family: 'Comfortaa', sans-serif;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(216, 94, 140, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(216, 94, 140, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(216, 94, 140, 0);
  }
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

#start-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #f6f8f3; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease;
  z-index: 110; 
}

.logo {
  width: 400px;
  max-width: 90vw;
  max-height: 400px;
  margin-bottom: 1rem;
  object-fit: contain;
}

#start-btn {
  padding: 15px 40px;
  font-size: 1.4rem;
  background-color: #d85e8c; 
  border: none;
  border-radius: 30px;
  cursor: pointer;
  color: white;
  font-weight: bold;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulse 2s infinite;
}

#start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

#start-btn:active {
  transform: scale(0.98);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: 0 2px 8px #c9e4c5;
  margin-bottom: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

#timer, #score, #lives {
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 90px;
  color: #3a5a40;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

.top-btn {
  background-color: #f8d7e0; 
  color: #7a3a40; 
  padding: 6px 15px;
  font-size: 0.85rem;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.top-btn:hover {
  background-color: #e9bccc;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.top-btn:active {
  background-color: #d79ca6;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.1);
  transform: scale(0.97);
}

.glow {
  box-shadow: 0 0 12px 6px rgba(216, 94, 140, 0.6); 
  border-radius: 12px; 
  transition: box-shadow 0.3s ease;
}

.highlight-score {
  color: #4caf50;
  font-weight: bold;
  animation: flashHighlight 0.5s ease;
}

.highlight-strikes {
  color: #f44336;
  font-weight: bold;
  animation: flashHighlight 0.5s ease;
}

@keyframes flashHighlight {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.customer-container {
  position: relative;
  max-width: 650px;
  width: 100%;
  margin: 0 auto 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: transparent;
  padding: 0;
}

.customer-container img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  display: block;
  user-select: none;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

#order-text {
  background-color: #fff7fa;
  border: 2px solid #d85e8c;
  border-radius: 20px;
  padding: 0 16px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  font-size: 1.1rem;
  font-weight: 600;
  width: 100%;
  max-width: 650px;
  margin: 0 auto 4px;
  display: block;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.modal-content {
  background-color: #fefefe;
  padding: 30px 40px;
  border-radius: 12px;
  border: 2px solid #7fb77e;
  max-width: 360px;
  width: 360px;
  color: #3a5a40;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  position: relative;
  user-select: text;
  gap: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.close {
  position: absolute;
  top: 10px; right: 14px;
  font-size: 28px;
  font-weight: bold;
  color: #7fb77e;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.close:hover {
  color: #4a774f;
}

#rules-modal { z-index: 101; }
#menu-modal { z-index: 102; }
#endgame-modal { z-index: 103; }

#menu-modal .menu-drink-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  font-size: 0.9rem;
  background-color: #f0c0cc;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  text-align: center;
}

#menu-modal .menu-drink-btn:hover {
  background-color: #e6a9b8;
  transform: scale(1.05);
  transition: 0.2s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

#menu-modal .menu-ingredients-icons {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: nowrap;
  user-select: none;
}

#menu-modal .menu-ingredients-icons img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

.menu-grid {
  display: grid;
  grid-template-rows: repeat(4, auto); 
  grid-auto-flow: column;             
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
}

.menu-grid button {
  padding: 6px;
  font-size: 0.9rem;
  background-color: #f0c0cc;
  color: #3a5a40;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  text-align: center;
}

.menu-grid button:hover {
  background-color: #e6a9b8;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: 0.2s ease;
}

.menu-grid button:active {
  transform: scale(0.97);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#menu-ingredients {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #3a5a40;
  font-weight: 600;
  text-align: center;
  word-wrap: break-word;
  white-space: normal;
  width: 100%;
  min-height: 48px;
  max-width: 100%;
  overflow-wrap: break-word;
}

.ingredients-area {
  background-color: #fff7fa;
  padding: 16px 8px;
  border-radius: 12px;
  margin-top: 2px;
  width: 100%;
  max-width: 650px; 
  overflow-x: hidden;
  margin-left: auto;
  margin-right: auto;
  box-shadow: inset 0 0 10px #e0e0d0;
}

.ingredients {
  background-color: #90bd82;
  padding: 10px; 
  border-radius: 10px; 
  display: grid;
  grid-auto-flow: column;     
  grid-template-rows: repeat(2, 110px);  
  grid-auto-columns: 110px;  
  gap: 6px;
  justify-content: center;
  margin: 0 auto;
  max-width: 100%;
  overflow-x: hidden;
}

.ingredient-btn, .trash-btn {
  width: 110px;
  height: 110px;
  padding: 0;
  margin: 0;
  transition: transform 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #d85e8c;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ingredient-btn img, .trash-btn img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  background: transparent;
}

.ingredient-btn:active,
.trash-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

#current-ingredients {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
  min-height: 48px;
}

#current-ingredients.empty::before {
  content: "Select ingredients…";
  color: #aaa;
  font-size: 0.9rem;
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 4px;
}

.highlight-red {
  animation: glowRed 0.8s ease;
}

@keyframes glowRed {
  0%, 100% {
    box-shadow: 0 0 8px 3px rgba(255, 77, 109, 0);
  }
  50% {
    box-shadow: 0 0 8px 3px rgba(255, 77, 109, 0.8);
  }
}

.tray-icon {
  animation: popIn 0.2s ease;
}

#current-ingredients img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

#submit-btn {
  margin-top: 16px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#result {
  margin-top: 14px;
  font-weight: 700;
  font-size: 1.25rem;
  color: #3a5a40;
  min-height: 28px;
  user-select: none;
}

.share-message {
  font-weight: 800;
  color: #d85e8c;
  font-size: clamp(1.4rem, 4vw, 2.4rem); 
  margin-bottom: 0; 
  text-align: center;
  max-width: 70vw;
  line-height: 1.2;
}

#save-instruction {
  color: #7a7a7a;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  text-align: center;
  max-width: 70vw;
  line-height: 1.3;
}

#report-card + .pink-btn,
.pink-btn {
  margin-top: 10px; 
}

#thankyou-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #f8f5ed; 
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: auto;         
  padding: 16px;
  box-sizing: border-box;
  animation: fadeIn 1s ease;
}

.thankyou-content {
  max-width: 650px;     
  width: 100%;
  max-height: 90vh;    
  overflow-y: auto;    
  padding: 20px;
  background: #f8f5ed;  
  border-radius: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.thankyou-buttons {
  margin-top: 20px;
  max-width: 80%;
  width: 70vw;
  display: flex;
  justify-content: center; 
  flex-direction: row; 
  gap: 10px;               
  flex-wrap: wrap;         
  padding: 0 10px;  
  align-items: center;        
}

/* Buttons */

.pink-btn {
  background-color: #d85e8c;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  user-select: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 120px;
  text-decoration: none;
  white-space: normal; 
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2; 
  min-width: 100px;   
  max-width: 200px;    
  flex: 1 1 auto;     
}

.pink-btn:hover {
  background-color: #c14d78;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transform: scale(1.05);
}

.pink-btn:active {
  background-color: #ad436a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: scale(0.97);
}

#skip-instruction-btn {
  background-color: #7cac74;
  color: white;
  border-radius: 25px;
  padding: 12px 25px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
  min-width: 120px;
}

#skip-instruction-btn:hover {
  background-color: #588b4a;
}

.hidden {
  display: none !important;
}

.highlight-glow {
  box-shadow: 0 0 12px 6px rgba(216, 94, 140, 0.6);
  border-radius: 12px;
}

@media (max-width: 320px) {
  .top-bar {
    padding: 4px 8px;
    gap: 8px;
  }
  #timer, #score, #lives {
    font-size: 0.8rem;
    min-width: auto;
  }
  .top-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    min-width: auto;
  }
  .ingredients {
    grid-template-rows: repeat(2, 60px);
    grid-auto-columns: 60px;
    gap: 2px;
    padding: 6px 8px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
  }
  .ingredient-btn, .trash-btn {
    width: 100%;
    max-width: 100%;
    height: 120px;
  }
  .ingredient-btn img, .trash-btn img {
    width: 90%;
    height: 90%;
    object-fit: contain;
  }
  .pink-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

/* Small phones */
@media (max-width: 450px) {
  .top-bar {
    padding: 4px 6px;
    gap: 6px;
  }
  #timer, #score, #lives {
    font-size: 0.9rem;
    min-width: 50px;
  }
  .ingredients {
    grid-template-rows: repeat(2, 80px);
    grid-auto-columns: 80px;
    gap: 6px;
    padding: 6px;
    justify-content: center;
  }
  .ingredient-btn, .trash-btn {
    width: 100%;
    max-width: 100%;
    height: 120px;
  }
  .ingredient-btn img, .trash-btn img {
    width: 90%;
    height: 90%;
    object-fit: contain;
  }
  .pink-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
.thankyou-buttons {
    margin-top: 20px;
    max-width: 90vw;
    gap: 6px;
    display: flex;         
    flex-direction: row;     
    justify-content: center; 
    flex-wrap: wrap;         
    align-items: center;
    padding: 0 10px;        
  }
  .thankyou-buttons .pink-btn {
    font-size: 0.85rem;
    padding: 8px 12px;
    min-width: 80px;
  }
}

@media (max-width: 600px) {
  .top-bar {
    padding: 6px 8px;
    gap: 8px;
  }
  #timer, #score, #lives {
    font-size: 1rem;
    min-width: 65px;
  }
  .pink-btn {
    padding: 12px 25px;
    font-size: 1rem;
  }
  .ingredients {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 120px);
    gap: 6px;
    padding: 8px;
    max-width: 100%;
    overflow-x: hidden;
  }
  .ingredient-btn, .trash-btn {
    width: 100%;
    max-width: 100%;
    height: 120px;
  }
  .ingredient-btn img, .trash-btn img {
    width: 90%;
    height: 90%;
    object-fit: contain;
  }
}

.drink-name {
  color: #d85e8c;
}

#final-image-preview {
  display: none;
  max-width: 80%;
  width: 70vw;
  margin-top: 10px;
  user-select: none;
  box-shadow: 0 0 12px 4px rgba(144, 238, 144, 0.5); 
  border-radius: 12px; 
  transition: box-shadow 0.3s ease;
  animation: glowPulse 2s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 12px 4px rgba(144, 238, 144, 0.5);
  }
  50% {
    box-shadow: 0 0 20px 6px rgba(144, 238, 144, 0.8);
  }
}