* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Rubik';
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  background: white;
  overflow: hidden;
  touch-action: none;
}

.container {
  height: 100dvh;
  width: 100%;
  max-width: 560px;
  padding: 20px;
  padding-top: 34px;
  margin: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.columns-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  flex-direction: column-reverse;
}


/* Adjust gap between columns on mobile */
@media (max-width: 699px) {
  .columns-row {
    gap: 16px;
    margin-top: 0;
    flex: 0 1 auto;
  }
}

.column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* On small screens, make each column full-width so inner content can truly center */
  width: 100%;
}

/* On mobile, make both columns only as tall as needed and align to top */
@media (max-width: 699px) {
  .column {
    flex: 0 1 auto;
    justify-content: flex-start;
  }
  
  .column:last-child {
    flex: 0 0 auto;
  }
}

/* Words list column behaviour on small screens */
.words-list {
  display: none; /* Hidden on mobile, shown in modal instead */
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  flex-shrink: 0;
  width: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.words-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* On wider screens, use side-by-side columns and remove height limit on words list */
@media (min-width: 700px) {
  .columns-row {
    flex-direction: row;
  }
  
  /* On large screens, push the letters grid to the right within its column */
  .columns-row > .column:first-child {
    justify-content: center;
  }
  
  /* On large screens, align the word list column to the top and center content */
  .columns-row > .column:last-child {
    justify-content: flex-start;
    align-items: center;
  }
  
   /* On large screens, align the letters grid to the right side of its column */
  .letters-grid-wrap {
    margin: 0 0 0 auto;
  }
  
  .words-list {
    display: block; /* Show on larger screens */
    max-height: 316px;
    text-align: left;
  }
  
  /* On large screens, allow columns to size naturally again */
  .column {
    width: auto;
  }
}

.snake-svg #snake-poly,
.snake-svg #snake-head {
  opacity: 1;
}

.snake-svg #snake-head {
  display: none;
}

.container.loaded {
  opacity: 1;
  visibility: visible;
}

.header {
  width: 100%;
  margin-bottom: 34px;
  text-align: center;
  flex-shrink: 0;
}

.header-title {
  color: #2a2a2a;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
}

#header-day {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  cursor: pointer;
  transition: color 0.2s ease;
}

#header-day:hover {
  color: #6fb05c;
}

/* Word count styles when shown in current-word element */
#current-word.word-count {
  color: #2a2a2a;
}

#current-word.word-count.instruction-text {
  color: #6fb05c !important;
}

/* On mobile, make current-wrap tappable when showing word count */
@media (max-width: 699px) {
  .current-wrap {
    cursor: default;
  }
  
  /* Show it's tappable when displaying word count */
  #current-word.word-count {
    cursor: pointer;
  }
  
  /* Make "words" text underlined on mobile */
  .words-label {
    text-decoration: underline;
    text-decoration-thickness: 3px;
  }
}

/* On desktop, add hover effect to words label */
@media (min-width: 700px) {
  .words-label {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    cursor: pointer;
    transition: color 0.2s ease;
  }
  
  .words-label:hover {
    color: #6fb05c;
  }
}

.words::-webkit-scrollbar { /* WebKit */
  display: none;
}

.word { 
  display: inline-block; 
  margin: 12px 10px 24px; 
  color: #e8eaed;
  padding: 3px 10px; 
  background: #e8eaed;
  font-weight: 700;
  font-size: 22px;
  cursor: pointer;
  position: relative;
  text-transform: uppercase;
  border-radius: 50px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.word.bonus { 
  display: none;
}

.word.found { 
  color: white;
  background-color: #6fb05c;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 600;;

}


/* Flip animation for newly found words */
.word.found.just-found {
  animation: word-found-celebration 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

@keyframes word-found-celebration {
  0% {
    transform: scale(0.3) rotateZ(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotateZ(5deg);
  }
  100% {
    transform: scale(1) rotateZ(0deg);
    opacity: 1;
  }
}

.word.bonus.found {
  display: inline-block;
  color: white;
  background-color: #e9ba3a;
  cursor: pointer;
  text-transform: capitalize;
}

.word-letter {
  display: inline-block;
}

.word-letter.first-letter {
  text-transform: capitalize;
}

.word-letter.hidden {
  color: transparent;
}

.word-letter.visible {
  color: inherit;
}

.word-letters-container {
  display: inline-block;
  letter-spacing: 0;
}

.word-letter-slot {
  display: inline-block;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

.word-letter-slot.revealed .word-letter-reveal {
  color: #2a2a2a;
}

.word.found .word-letter-reveal {
  color: white;
}

.word-letter-reveal {
  display: inline-block;
  margin: 0;
  padding: 0;
  color: transparent;
}

.word-dots-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.word-dot {
  display: none;
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  margin: 0 2px;
  transition: opacity 0.2s ease;
}

.word-dot.hidden {
  opacity: 0;
}

.letters-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 20px;
}

/* Reduce margin on mobile */
@media (max-width: 699px) {
  .letters-wrap {
    margin-bottom: 0;
  }
}

/* Completion Section Styles */
.completion-section {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
  padding-top: 20px;
  flex-shrink: 0;
  opacity: 0;
  animation: celebrateIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.completion-section.show {
  display: flex;
}

@keyframes celebrateIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.completion-text {
  font-size: 26px;
  font-weight: 700;
  color: #2a2a2a;
  line-height: 1.3;
  text-align: center;
}

.completion-time {
  font-size: 26px;
  font-weight: 700;
  color: #2a2a2a;
  text-align: center;
  line-height: 1.3;
}

.completion-ranking {
  font-size: 26px;
  font-weight: 700;
  color: #6fb05c;
  text-align: center;
  margin-top: 8px;
}

.more-puzzles-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  width: 100%;
  max-width: 260px;
  text-transform: none;
  margin-top: 24px;
}

.more-puzzles-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.more-puzzles-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Completion Modal Styles */
.completion-modal {
  max-width: 90%;
  width: 450px;
  text-align: center;
}

.completion-title {
  font-size: 26px;
  font-weight: 700;
  color: #4caf50;
  line-height: 1.3;
}

.countdown-container {
  background: #f8f8f8;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.countdown-label {
  font-size: 16px;
  color: #555;
  margin-bottom: 8px;
  font-weight: 600;
}

.countdown-timer {
  font-size: 32px;
  font-weight: 700;
  color: #4caf50;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
}

.countdown-container-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: white;
}

.countdown-label-simple {
  font-size: 16px;
  color: #333;
  font-weight: 700;
  flex: 1;
}

.countdown-container-simple .countdown-timer {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  padding: 4px 8px;
  border-radius: 4px;
}

.completion-play-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 18px 36px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 24px;
  text-transform: none;
}

.completion-play-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.completion-play-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.current-wrap { 
  position: relative;
  height: 42px; 
  font-size: 26px; 
  font-weight: 700;
  line-height: 42px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a2a2a;
  width: 100%;
  flex-shrink: 0;
}



#current-word.error-message {
  color: #e74c3c;
}

#current-word.success-message {
  color: #4caf50;
}

#current-word.bonus-message {
  color: #e9ba3a;
}


.letters-grid-wrap {
  flex: 1;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Default (small screens): center the grid within the column */
  margin: 0 auto;
}


.snake-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#snake-poly {
  transition: all 0.1s ease-out;
}

.letters {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  gap: 8px;
  justify-content: center;
  align-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.letter {
  width: 100px;
  height: 100px;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.15s ease-out;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  color: #2a2a2a;
  position: relative;
}

.letter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #e8eaed;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 2;
}

.letter-text {
  position: relative;
  z-index: 2;
  color: inherit;
}

.letter-counter {
  position: absolute;
  bottom: 7px;
  right: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #999;
  z-index: 3;
  pointer-events: none;
}

.letter.selected .letter-text {
  color: white;
  /* background: #c8e6c9;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  border: 2px solid #4caf50; */
}

.letter.highlighted {
  background: #fff3e0;
  border: 2px solid #ff9800;
  box-shadow: 0 4px 8px rgba(255, 152, 0, 0.15);
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.loader-text {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.loader-subtext {
  font-size: 14px;
  color: #666;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
}

/* Definition modal should appear on top of other modals */
#modal-overlay {
  z-index: 1100;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 90vw;
  width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: scale(0.8);
  text-align: left;
  position: relative;
  overflow: auto;
  max-height: 90vh;
  margin: 20px;
}

.definition-modal {
  width: 450px;
  max-width: 90vw;
}

.modal-header {
  margin-bottom: 24px;
  text-align: center;
}

.modal-word {
  font-size: 30px;
  font-weight: 700;
  text-transform: capitalize;
  color: #333;
}

.modal-word.bonus {
  color: #e9ba3a;
}

.modal-close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 28px;
  font-weight: 700;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  z-index: 3;
}

.modal-close-x:hover { 
  background: #f3f3f3; 
  color: #333; 
}

.modal-close {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 20px;
}

.modal-close:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.modal-close:active {
  transform: translateY(0);
}

.modal-definition {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: #444;
  margin-bottom: 24px;
  text-align: center;
}

.modal-example {
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.5;
  color: #888;
  margin-bottom: 24px;
  text-align: center;
}

.continue-playing-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 20px;
  text-transform: none;
}

.continue-playing-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.continue-playing-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Info Modal Styles */
.info-modal {
  max-width: 90%;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.info-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.info-content {
  font-size: 16px;
  line-height: 1.6;
  color: #444;
  text-align: left;
}

.info-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 20px 0 10px 0;
}

.info-content p {
  margin-bottom: 12px;
}

.info-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.info-content li {
  margin-bottom: 8px;
}

.info-highlight {
  background: #f0f8f0;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #4caf50;
  margin: 16px 0;
  font-weight: 500;
}

/* Words List Modal Styles (for mobile) */
.words-list-modal {
  max-width: 90%;
  width: 500px;
  max-height: 80vh;
}

.words-list-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}

.words-list-modal-content {
  max-height: 60vh;
  overflow-y: auto;
  text-align: center;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.words-list-modal-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}


/* Puzzle List Modal Styles */
.puzzle-list-modal {
  max-width: 90%;
  width: 500px;
  max-height: 80vh;
}

.puzzle-list-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.puzzle-tab {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  background: #f5f5f5;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.puzzle-tab:hover {
  background: #e8e8e8;
  color: #333;
}

.puzzle-tab.active {
  background: #4caf50;
  color: white;
}

.puzzle-list-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}

.puzzle-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.puzzle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.puzzle-item.current {
  background: #e8f5e8;
  border-color: #4caf50;
  border-width: 2px;
}

.puzzle-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.puzzle-number {
  font-weight: 700;
  font-size: 16px;
  color: #333;
}

.puzzle-details {
  font-size: 14px;
  color: #666;
  margin-top: 2px;
}

.puzzle-status {
  font-weight: 700;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
}

.puzzle-status.solved {
  background: #c8e6c9;
  color: #2e7d32;
}

.puzzle-status.partial {
  background: #fff3e0;
  color: #f57c00;
}

.puzzle-status.unsolved {
  background: #ffebee;
  color: #c62828;
}

/* Hints Modal Styles */
.hints-modal {
  max-width: 90%;
  width: 400px;
  text-align: center;
}

.hints-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
}

.hints-message {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin-top: 16px;
}

/* First Letter Counter Modal Styles */
.first-letter-counter-modal {
  max-width: 90%;
  width: 400px;
  text-align: center;
}

.first-letter-counter-title {
  font-size: 22px;
  font-weight: 700;
  color: #4caf50;
}

.first-letter-counter-message {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin-top: 16px;
}

.first-letter-counter-continue-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 20px;
  text-transform: none;
}

.first-letter-counter-continue-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.first-letter-counter-continue-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* First Hint Modal Styles */
.first-hint-modal {
  max-width: 90%;
  width: 400px;
  text-align: center;
}

.first-hint-title {
  font-size: 22px;
  font-weight: 700;
  color: #4caf50;
}

.first-hint-message {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin-top: 16px;
}

.first-hint-continue-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 20px;
  text-transform: none;
}

.first-hint-continue-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.first-hint-continue-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* First Bonus Modal Styles */
.first-bonus-modal {
  max-width: 90%;
  width: 400px;
  text-align: center;
}

.first-bonus-title {
  font-size: 22px;
  font-weight: 700;
  color: #e9ba3a;
}

.first-bonus-message {
  font-size: 18px;
  line-height: 1.6;
  color: #666;
  margin-top: 16px;
}

.first-bonus-continue-button {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 20px;
  text-transform: none;
}

.first-bonus-continue-button:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.first-bonus-continue-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Page-specific overrides */
.container {
  max-width: 700px;
}

/* Feedback message styles */
.current-wrap {
  opacity: 1;
  transition: opacity 0.2s ease;
}


#current-word {
  line-height: 42px;
}

#current-word.forming {
  color: #2a2a2a;
}

#current-word.success {
  color: #4caf50;
  animation: success-pulse 0.5s ease;
}

#current-word.bonus {
  color: #e9ba3a;
  animation: success-pulse 0.5s ease;
}

#current-word.error {
  color: #e74c3c;
  animation: error-shake 0.4s ease;
}

/* On desktop, sync success animation with word animation */
@media (min-width: 700px) {
  #current-word.success,
  #current-word.bonus {
    animation: success-celebration 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

@keyframes success-pulse {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
}

@keyframes success-celebration {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Letter grid subtle animations */
.letters.grid-success-pulse {
  animation: gridSuccessPulse 0.5s ease;
}

/* On desktop, disable grid animations but enable word shake */
@media (min-width: 700px) {
  .letters.grid-success-pulse {
    animation: none;
  }
  
  .word.word-shake {
    animation: wordShake 0.4s ease;
  }
}

@keyframes gridSuccessPulse {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.03); }
  60% { transform: scale(0.98); }
}

@keyframes gridErrorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@keyframes wordShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Completion Animation Styles */
.letter.completed-green::before {
  background: #6fb05c;
}

.letter.completed-green .letter-text {
  color: white;
}

/* Anticipation pulse - all tiles pulse slightly */
.letter.anticipation-pulse {
  animation: anticipationPulse 0.4s ease-out;
}

@keyframes anticipationPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Green wave sweep */
.letter.green-sweep::before {
  animation: greenSweep 0.3s ease-out forwards;
}

@keyframes greenSweep {
  0% {
    background: #e8eaed;
  }
  100% {
    background: #6fb05c;
  }
}

/* Celebratory wave - bigger and more dramatic */
.letter.wave-animate {
  animation: dramaticWave 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dramaticWave {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-40px) scale(1.1);
  }
  60% {
    transform: translateY(-40px) scale(1.1);
  }
}

/* Rainbow color animation */
.letter.rainbow-animate::before {
  animation: rainbowBackgrounds 1.5s ease-in-out !important;
}

.letter.rainbow-animate .letter-text {
  color: white;
}

@keyframes rainbowBackgrounds {
  0% { background: #B84451; }
  20% { background: #D5713E; }
  40% { background: #E9AF34; }
  60% { background: #9FAD44; }
  80% { background: #8D4B86; }
  100% { background: #6fb05c; }
}

/* Final settle pop */
.letter.settle-pop {
  animation: settlePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes settlePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
