/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  background: #f4f4f9;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  line-height: 1.6;
}

/* Main container */
.game-container {
  background: #b8e6b8;
  border: 2px solid #000000;
  max-width: 600px;
  width: 100%;
  padding: 20px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.2);
  border-radius: 0; /* Changed */
}

/* Header Styles */
.title {
  font-size: clamp(1.5rem, 4vw, 2rem); /* Adjusted for pixel font size */
  font-weight: 400; /* Pixel fonts usually don't need bold */
  color: #000000;
  margin-bottom: 15px;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  position: relative;
  line-height: 1.4;
}

.pixel-font {
  font-family: 'Press Start 2P', cursive;
}

.subtitle {
  font-size: 1rem;
  color: #000000;
  margin-bottom: 10px;
  font-weight: 400;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.game-number {
  font-size: 0.9rem;
  color: #000000;
  margin-bottom: 15px;
  font-weight: 500;
  opacity: 0.8;
}

/* Streak Styles */
.streak-container {
  margin-bottom: 20px;
}

.streak-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border: 2px solid #000;
  border-radius: 0;
  transition: all 0.3s ease;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
}

.streak-display.animate {
  animation: streakPulse 0.6s ease-in-out;
}

.streak-icon {
  font-size: 1.2em;
}

.streak-text {
  font-weight: 600;
  color: #000000;
  font-size: 0.8rem;
  font-family: 'Press Start 2P', cursive;
  line-height: 1.5;
}

/* Progress indicators as Squares */
.progress-container {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  width: auto;
  height: auto;
  background-color: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  display: flex;
  gap: 15px; /* Increased from 8px */
}

/* We will use JS to generate these squares, or CSS to style the existing structure if possible. 
   But the existing structure is a single bar. We need to change the HTML structure or use pseudo-elements?
   Actually, the best way is to change the HTML structure in index.html to be a list of squares, 
   OR use the existing .progress-bar container and fill it with square divs via JS. 
   Let's assume we will update JS to populate .progress-bar with squares.
   For now, let's style the "squares" that will be added.
*/

.attempt-square {
  width: 20px;
  height: 20px;
  border: 2px solid #000;
  background: transparent;
  display: inline-block;
}

.attempt-square.filled {
  background: #000;
}

.attempt-square.correct {
  background: #4caf50; /* Green */
  border-color: #4caf50;
}

.attempt-square.incorrect {
  background: #f44336; /* Red */
  border-color: #f44336;
}

.progress-bar-fill {
  display: none; /* Hide the old bar fill */
}

.attempt-counter {
  color: #000000 !important;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Press Start 2P', cursive;
}

/* Notes grid */
.notes-grid {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.note-card {
  background: #b8e6b8;
  border: 2px solid #000000;
  border-radius: 0; /* Changed */
  padding: 10px;
  box-shadow: none; /* Changed */
  transition: none; /* Changed */
  width: 90px;
  flex-shrink: 0;
}

.note-card:hover {
  transform: none; /* Changed */
  box-shadow: none; /* Changed */
  background: #a8d6a8;
}

.note-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: 0; /* Changed */
  transition: none; /* Changed */
}

.note-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: #000000;
  text-transform: capitalize;
}

/* Input section */
.guess-section {
  margin: 30px 0;
  position: relative;
}

.search-row {
  display: flex;
  align-items: center; /* Align items vertically */
  gap: 10px;
  justify-content: center;
  width: 100%; /* Take full width */
  max-width: 510px; /* Match notes grid width (90*5 + 15*4) */
  margin: 0 auto 15px; /* Center the row */
}

.input-container {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 0; /* Removed margin */
  flex: 1; /* Allow it to grow */
}

#guessInput {
  width: 100%;
  max-width: none; /* Remove max-width to let it fill available space */
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #000; /* Changed */
  border-radius: 0; /* Changed */
  outline: none;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-shadow: none;
}

#guessInput:focus {
  border-color: #000;
  box-shadow: none; /* Changed */
  background: white;
}

#guessInput::placeholder {
  color: #666;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0; /* Ensure no extra margin */
}

#guessBtn,
#resetBtn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #000; /* Changed */
  border-radius: 0; /* Changed */
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  min-width: 100px;
  box-shadow: none;
}

#guessBtn:hover:not(:disabled) {
  background: #fff;
  border-color: #000;
  transform: none; /* Changed */
  box-shadow: none; /* Changed */
}

#guessBtn:disabled {
  background: rgba(255, 255, 255, 0.5);
  border-color: #999;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#resetBtn {
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  display: none;
}

#resetBtn:hover {
  background: #fff;
  border-color: #000;
  transform: none; /* Changed */
  box-shadow: none; /* Changed */
}

/* Autocomplete suggestions */
.suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 15px;
  max-width: 450px;
  max-height: 150px;
  overflow-y: auto;
  background: #fff;
  border-radius: 0; /* Changed */
  box-shadow: none; /* Changed */
  border: 2px solid #000; /* Changed */
  position: relative;
  z-index: 10;
  text-align: left;
}

.suggestions-list:empty {
  display: none;
}

.suggestions-list li {
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #ccc; /* Changed */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

.suggestions-list li:hover {
  background-color: rgba(184, 230, 184, 0.5); /* Changed */
}

/* Hints container */
.hints-container {
  margin-top: 30px;
  text-align: left;
}

.hint-card {
  background: white;
  border-radius: 0; /* Changed */
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: none; /* Changed */
  border: 2px solid #000; /* Changed */
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hint-card.fade-in {
  animation: fadeInUp 0.5s ease-out;
}

.hint-card.correct-guess {
  border-color: #4caf50; /* Changed */
  background: #f8fff9; /* Changed */
}

.hint-card.incorrect-guess {
  border-color: #ff9800; /* Changed */
}

.attempt-label {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.hint-content {
  color: #555;
  font-size: 1rem;
  line-height: 1.5;
}

.correct-guess .hint-content {
  color: #2e7d32;
  font-weight: 600;
}

/* All other styles (share, countdown, modal, etc.) would also have border-radius removed and shadows replaced with borders if applicable. */

/* Share Section Styles */
.share-section {
  margin-top: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0; /* Changed */
  border: 2px solid black;
  text-align: center;
}

.share-section h3 {
  color: #000000;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.share-button {
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  border: 2px solid #000;
  padding: 12px 20px;
  border-radius: 0; /* Changed */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
}

.share-button:hover {
  background: #fff;
  transform: none;
  box-shadow: none;
}

.share-preview {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0; /* Changed */
  border: 1px solid #000;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-line;
  text-align: left;
  color: #333;
}

/* Other sections like countdown, modal, etc. would follow the same pattern */

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .search-row {
    flex-direction: row; /* Force row direction on mobile */
    align-items: center;
    max-width: 382px; /* Match notes grid width (70*5 + 8*4) */
  }
  
  .input-container {
    margin-bottom: 0;
  }

  body {
    padding: 10px;
  }
  
  .game-container {
    padding: 15px 10px;
  }
  
  .notes-grid {
    gap: 8px;
    flex-wrap: nowrap; /* Keep notes in a single row */
    overflow-x: visible; /* Changed from auto */
    padding: 0 10px; /* Increased padding to prevent border clipping */
    margin: 30px -5px; /* Negative margin to compensate */
  }
  
  .note-card {
    width: 70px;
    padding: 8px;
    flex-shrink: 0;
  }
  
  .note-img {
    width: 45px;
    height: 45px;
  }
  
  .note-name {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .notes-grid {
    gap: 6px;
  }

  .search-row {
    max-width: 324px; /* Match notes grid width (60*5 + 6*4) */
  }
  
  .note-card {
    width: 60px;
    padding: 6px;
  }
  
  .note-img {
    width: 35px;
    height: 35px;
  }
  
  .note-name {
    font-size: 0.65rem;
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .notes-grid {
    gap: 4px;
  }

  .search-row {
    max-width: 291px; /* Match notes grid width (55*5 + 4*4) */
  }
  
  .note-card {
    width: 55px;
    padding: 5px;
  }
  
  .note-img {
    width: 30px;
    height: 30px;
  }
  
  .note-name {
    font-size: 0.6rem;
  }
}
