[hidden] { display: none !important; }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-dark);
  text-align: center;
  flex: 1;
}

.screen {
  padding: 10px 20px 50px;
  display: flex;
  justify-content: center;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  text-align: center;
}

.card h2 { margin-top: 0; color: var(--primary-dark); }

.choice-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}

.choice-btn {
  flex: 1 1 120px;
  border: 3px solid transparent;
  background: #f1f1f1;
  border-radius: 16px;
  padding: 14px 10px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.choice-btn .label { font-size: 0.85rem; }
.choice-btn.selected { border-color: var(--primary); background: #fff0eb; }

/* ---------- Game layout ---------- */
.game-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.board-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  width: 100%;
}

.prompt-banner {
  width: 100%;
  text-align: center;
  margin-bottom: 16px;
}

.progress-label {
  display: inline-block;
  background: linear-gradient(135deg, #8fa8ff, #5d78e6);
  color: white;
  font-weight: bold;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
}

/* ---------- Picture card ---------- */
.picture-card {
  width: 100%;
  background: #f0f4ff;
  border: 2px solid #cdd8ff;
  border-radius: 20px;
  padding: 18px 16px 20px;
  text-align: center;
  position: relative;
  margin-bottom: 18px;
}

.category-tag {
  display: inline-block;
  background: var(--secondary);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: capitalize;
}

.picture-emoji {
  font-size: 4.2rem;
  line-height: 1;
  margin: 4px 0 6px;
}

.meaning-label {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 10px;
}

.word-display {
  font-size: 2.4rem;
  font-weight: bold;
  color: var(--primary-dark);
  letter-spacing: 1px;
  direction: ltr;
}

.word-part {
  white-space: pre;
}

.word-blank {
  display: inline-block;
  min-width: 0.9em;
  border-bottom: 4px dashed var(--primary);
  color: var(--primary);
  margin: 0 2px;
  transition: color 0.2s ease;
}

.word-blank.filled {
  border-bottom-style: solid;
  border-bottom-color: #4d9c6c;
  color: #4d9c6c;
}

.repeat-btn {
  margin-top: 12px;
  border: none;
  background: var(--secondary);
  color: white;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
}
.repeat-btn:hover { background: var(--secondary-dark); }
.repeat-btn:active { transform: translateY(2px); box-shadow: none; }

/* ---------- Letter options ---------- */
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.letter-btn {
  min-width: 70px;
  padding: 12px 10px;
  border-radius: 16px;
  border: 3px solid #dbe4ee;
  background: #f7fafc;
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}

.letter-btn:hover {
  border-color: var(--secondary);
  transform: translateY(-2px);
}

.letter-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.letter-btn.correct-pick {
  background: #d9f5e3;
  border-color: #4d9c6c;
  color: #2f7a4d;
}

.letter-btn.wrong-pick {
  background: #ffe3e3;
  border-color: #d94b4b;
  color: #b23b3b;
  animation: letterShake 0.4s ease;
}

.letter-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

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

.feedback-banner {
  margin-top: 14px;
  width: 100%;
  text-align: center;
  font-weight: bold;
  font-size: 1.05rem;
  padding: 10px 16px;
  border-radius: 14px;
}
.feedback-banner.good {
  background: #d9f5e3;
  color: #2f7a4d;
}
.feedback-banner.bad {
  background: #ffe3e3;
  color: #b23b3b;
}
.feedback-banner.hint {
  background: #fff3d6;
  color: #9a6b0a;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .topbar h1 { font-size: 1.25rem; }
  .picture-emoji { font-size: 3.4rem; }
  .word-display { font-size: 2rem; }
}
