/* Start screen */
#screen-start .container {
  text-align: center;
  padding-top: 40px;
}

.scores-box {
  margin-top: 32px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: left;
}

.scores-box h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--secondary-dark);
}

.scores-box ol {
  padding-left: 24px;
}

.scores-box li {
  padding: 4px 0;
  font-size: 0.95rem;
}

.scores-box li .score-name {
  font-weight: 700;
}

.scores-box li .score-pts {
  color: var(--primary);
  font-weight: 700;
}

/* Game screen */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.round-counter, .score-display {
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--white);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.image-container {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
}

/* Letter slots */
.letter-slots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.letter-slot {
  width: 44px;
  height: 52px;
  border: 3px solid var(--secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--white);
  transition: border-color 0.2s, transform 0.15s;
}

.letter-slot.filled {
  border-color: var(--primary);
  transform: scale(1.05);
}

.letter-slot.correct {
  border-color: var(--correct);
  background: #d4efdf;
}

.letter-slot.fixed {
  background: #eee;
  border-color: var(--text-light);
  color: var(--text);
  cursor: default;
  transform: none;
}

.letter-slot.incorrect {
  border-color: var(--incorrect);
  background: #fadbd8;
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.letter-slot.pop {
  animation: pop 0.25s;
}

/* Feedback */
.feedback {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  min-height: 32px;
  margin-bottom: 8px;
}

.feedback.correct-msg {
  color: var(--correct);
}

.feedback.incorrect-msg {
  color: var(--incorrect);
}

.feedback.hint-msg {
  color: var(--secondary-dark);
  font-size: 1.8rem;
}

.hint-letter {
  display: inline-block;
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 4px;
}

.hint-letter.hint-placed {
  text-decoration: overline;
  text-decoration-color: var(--correct);
  text-decoration-thickness: 3px;
  color: var(--correct);
}

/* Game actions */
.game-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}

.game-actions .btn {
  padding: 10px 24px;
  font-size: 1rem;
}

/* On-screen keyboard */
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.keyboard-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.key {
  width: 34px;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 2px 0 #ccc;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  transition: background 0.1s;
}

.key:active {
  background: #e0e0e0;
  box-shadow: 0 1px 0 #ccc;
  transform: translateY(1px);
}

.key.key-wide {
  width: 64px;
  font-size: 0.85rem;
}

/* End screen */
#screen-end .container {
  text-align: center;
  padding-top: 40px;
}

.final-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin: 20px 0;
}

.name-input-group {
  margin: 24px 0;
}

.name-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 1.1rem;
}

.name-input-group input {
  width: 100%;
  max-width: 300px;
  padding: 14px 18px;
  border: 3px solid var(--secondary);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 1.2rem;
  text-align: center;
  outline: none;
}

.name-input-group input:focus {
  border-color: var(--primary);
}

#screen-end .btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 10px auto;
}

.save-message {
  margin-top: 16px;
  font-weight: 700;
  color: var(--correct);
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Responsive */
@media (min-width: 480px) {
  .key {
    width: 42px;
    height: 56px;
    font-size: 1.2rem;
  }
  .key.key-wide {
    width: 80px;
  }
  .letter-slot {
    width: 50px;
    height: 58px;
    font-size: 1.8rem;
  }
  .hint-letter {
    font-size: 2rem;
    margin: 0 5px;
  }
}

@media (max-width: 360px) {
  .key {
    width: 28px;
    height: 42px;
    font-size: 0.95rem;
  }
  .key.key-wide {
    width: 52px;
  }
  .letter-slot {
    width: 36px;
    height: 44px;
    font-size: 1.3rem;
  }
  .title {
    font-size: 2rem;
  }
  .hint-letter {
    font-size: 1.5rem;
    margin: 0 3px;
  }
}
