* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  overflow: hidden;
  background: #1a1510;
}

#canvas-container {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* Instruction overlay */
#instruction-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.instruction-card {
  background: linear-gradient(145deg, #2d2520 0%, #1f1a16 100%);
  border: 2px solid #8b7355;
  border-radius: 16px;
  padding: 2.5rem 3rem;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(139, 115, 85, 0.2);
}

.instruction-card h1 {
  color: #e8dcc8;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

.instruction-card p {
  color: #c4b8a8;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.instruction-card ol {
  color: #c4b8a8;
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  line-height: 1.8;
}

.instruction-card li strong {
  color: #e8dcc8;
}

#start-btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-family: inherit;
  font-size: 1.1rem;
  background: linear-gradient(180deg, #8b7355 0%, #6b5344 100%);
  color: #f5efe6;
  border: 1px solid #a08060;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 115, 85, 0.4);
}

/* Prayer and Window overlay */
#prayer-overlay,
#window-overlay,
#lecha-dodi-overlay,
#maariv-overlay,
#washing-hands-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 16, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.prayer-card {
  background: linear-gradient(145deg, #2d2520 0%, #1f1a16 100%);
  border: 2px solid #8b7355;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
    /* For absolute button positioning */
  }
  
    #close-x-btn,
                #close-window-x-btn,
                #close-lecha-x-btn,
                                                                                                                                #close-maariv-x-btn,
                                                                                                                                #close-washing-x-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #8b7355;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
  }
  
        #close-x-btn:hover,
        #close-window-x-btn:hover,
        #close-lecha-x-btn:hover,
                                                                #close-maariv-x-btn:hover,
                                                                #close-washing-x-btn:hover {
    color: #e8dcc8;
}

.prayer-card h2 {
  color: #e8dcc8;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  text-align: center;
}

#prayer-content,
#window-content,
#lecha-content,
#maariv-content,
#washing-content {
  color: #c4b8a8;
  line-height: 1.9;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

#window-content p,
#lecha-content p,
#maariv-content p,
#washing-content p {
  margin-bottom: 1rem;
}

#window-content strong,
#lecha-content strong,
#maariv-content strong,
#washing-content strong {
  color: #e8dcc8;
}

#prayer-content {
  white-space: pre-wrap;
    /* Respect newlines in text */
}

#prayer-content .hebrew {
  font-size: 1.5rem;
  direction: rtl;
  text-align: center;
  margin: 0.75rem 0;
  color: #e8dcc8;
}

#prayer-content .transliteration {
  font-style: italic;
  margin: 0.5rem 0;
}

#prayer-content .translation {
  margin: 0.5rem 0;
  opacity: 0.95;
}

#close-prayer-btn,
#close-window-btn,
#close-lecha-btn,
#close-maariv-btn,
#close-washing-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  background: linear-gradient(180deg, #8b7355 0%, #6b5344 100%);
  color: #f5efe6;
  border: 1px solid #a08060;
  border-radius: 8px;
  cursor: pointer;
}

#close-prayer-btn:hover {
  background: linear-gradient(180deg, #9b8365 0%, #7b6354 100%);
}

/* Hint overlay (wrong order) */
#hint-overlay {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45, 37, 32, 0.95);
  border: 1px solid #8b7355;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  z-index: 15;
  animation: fadeInUp 0.3s ease;
}

#hint-overlay p {
  color: #e8dcc8;
  font-size: 0.95rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Finale overlay */
#finale-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 12, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.finale-card {
  text-align: center;
  padding: 3rem;
}

.finale-card .shabbat-shalom {
  font-size: 3.5rem;
  color: #e8dcc8;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 40px rgba(232, 220, 200, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(232, 220, 200, 0.2); }
  to { text-shadow: 0 0 50px rgba(232, 220, 200, 0.4); }
}

.finale-card p {
  color: #c4b8a8;
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

#replay-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  background: linear-gradient(180deg, #8b7355 0%, #6b5344 100%);
  color: #f5efe6;
  border: 1px solid #a08060;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#replay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 115, 85, 0.4);
}

/* Share Button */
#share-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(45, 37, 32, 0.85);
  backdrop-filter: blur(4px);
  color: #e8dcc8;
  border: 1px solid #8b7355;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#share-btn:hover {
  background: rgba(139, 115, 85, 0.9);
  color: #f5efe6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#share-btn svg {
  width: 18px;
  height: 18px;
}

/* Toast Notification */
#toast-notification {
  position: fixed;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 15, 12, 0.95);
  color: #e8dcc8;
  border: 1px solid #8b7355;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}