/* Sentence Fill-in-the-Blank Game CSS */

/* Game Header */
.fb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.fb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
  font-family: 'Courier New', monospace;
}

.fb-pill strong {
  font-weight: 700;
}

/* Combo indicator */
.fb-combo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #ff6584, #c084fc);
  border-radius: 6px;
  font-size: 0.875rem;
  color: #fff;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.fb-combo.visible {
  opacity: 1;
  animation: fb-combo-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fb-combo-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.fb-combo-num {
  font-weight: 700;
  font-size: 1rem;
}

/* Game Area */
.fb-game-area {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* English Phrase Display */
.fb-english-wrap {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.1), rgba(255, 101, 132, 0.1));
  border-radius: 8px;
  border: 1px solid rgba(192, 132, 252, 0.2);
}

.fb-english-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 6px;
  display: block;
}

.fb-english {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Japanese Sentence Display */
.fb-partial-wrap {
  text-align: center;
  padding: 20px;
  background: var(--bg3);
  border-radius: 8px;
  border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.fb-partial-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 8px;
  display: block;
}

.fb-partial-jp {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Blank marker styling */
.fb-partial-jp .fb-blank {
  display: inline-block;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, #c084fc, #ff6584);
  margin: 0 4px;
  vertical-align: middle;
  animation: fb-blank-pulse 1.2s ease-in-out infinite;
}

@keyframes fb-blank-pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Audio Button */
.fb-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 12px;
  padding: 0;
  background: linear-gradient(135deg, #c084fc, #ff6584);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fb-audio-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.4);
}

.fb-audio-btn:active {
  transform: scale(0.95);
}

.fb-audio-btn::before {
  content: '🔊';
}

/* Options Grid */
.fb-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0;
}

/* Option Button */
.fb-option-btn {
  padding: 16px 12px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 2px solid color-mix(in srgb, var(--text) 15%, transparent);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.4;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-option-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 12%, transparent);
  border-color: rgba(192, 132, 252, 0.5);
  transform: translateY(-2px);
}

.fb-option-btn:active:not(:disabled) {
  transform: translateY(0);
}

.fb-option-btn:disabled {
  cursor: not-allowed;
}

/* Correct Answer */
.fb-option-btn.correct {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
  border-color: #4caf50;
  color: #4caf50;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
  animation: fb-correct-flash 0.4s ease;
}

@keyframes fb-correct-flash {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Incorrect Answer */
.fb-option-btn.incorrect {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.3), rgba(244, 67, 54, 0.1));
  border-color: #f44336;
  color: #f44336;
  animation: fb-incorrect-shake 0.4s ease;
}

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

/* Show Correct Answer Highlight */
.fb-option-btn.show-correct {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.05));
  border-color: rgba(76, 175, 80, 0.5);
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

/* Completion Screen */
.fb-complete {
  display: none;
  text-align: center;
  padding: 48px 32px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.1), rgba(255, 101, 132, 0.1));
  border-radius: 12px;
  border: 2px solid rgba(192, 132, 252, 0.2);
}

.fb-complete.show {
  display: block;
  animation: fb-complete-fade-in 0.5s ease;
}

@keyframes fb-complete-fade-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb-complete-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.fb-complete-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  font-family: 'Space Grotesk', sans-serif;
}

.fb-complete-msg {
  font-size: 1rem;
  color: var(--text3);
  margin: 0 0 24px;
}

.fb-complete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.fb-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #c084fc, #ff6584);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fb-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.4);
}

.fb-btn:active {
  transform: translateY(0);
}

.fb-btn-secondary {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
}

.fb-btn-secondary:hover {
  background: color-mix(in srgb, var(--text) 15%, transparent);
}

/* Responsive Design */
@media (max-width: 640px) {
  .fb-options {
    grid-template-columns: 1fr;
  }

  .fb-english {
    font-size: 1.25rem;
  }

  .fb-partial-jp {
    font-size: 1.4rem;
  }

  .fb-option-btn {
    padding: 14px 10px;
    font-size: 0.9rem;
    min-height: 56px;
  }

  .fb-header {
    flex-direction: column;
    align-items: stretch;
  }

  .fb-pill {
    justify-content: center;
  }
}
