/* ===== Shared Game Page Chrome ===== */

.game-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.back-btn {
  font-size: 1rem;
  padding: 8px 16px;
  min-width: auto;
  min-height: auto;
}

.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.game-score {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 600;
}

.score-label {
  opacity: 0.6;
  font-size: 0.9rem;
}

.score-value {
  font-size: 1.4rem;
  color: var(--btn-primary);
}

/* --- Game Area --- */
.game-area {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 20px;
}

/* --- Prompt / Question Text --- */
.game-prompt {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 20px;
  animation: fade-in 0.4s ease;
}

.game-prompt .target-number {
  color: var(--btn-primary);
  font-size: 2.5rem;
}

/* --- Answer Button Row --- */
.answer-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 12px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 12px auto;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--btn-primary), var(--star-color));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* --- Round Counter --- */
.round-counter {
  font-size: 1rem;
  opacity: 0.6;
  margin-bottom: 8px;
  color: var(--text-dark);
}

/* --- Feedback Message --- */
.feedback {
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback--correct {
  color: var(--correct);
  animation: pop-in 0.3s ease;
}

.feedback--incorrect {
  color: var(--incorrect);
  animation: wiggle 0.4s ease;
}

/* --- Celebration Overlay --- */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.celebration-overlay--visible {
  opacity: 1;
}

.celebration-content {
  text-align: center;
  animation: pop-in 0.5s ease;
}

.celebration-confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.celebration-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.celebration-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Operator Stage (shared by addition / subtraction) --- */
.op-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  min-height: 280px;
  padding: 20px;
}

.block-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.op-stage .operator {
  font-size: 2.5rem;
  font-weight: 700;
  color: #bbb;
  padding-bottom: 28px;
}

.result-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  min-height: 90px;
  border: 3px dashed #ddd;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.6);
  padding: 8px;
  margin-bottom: 28px;
}

.result-slot--revealed {
  border-color: var(--correct);
  border-style: solid;
  background: rgba(102, 187, 106, 0.08);
  animation: celebrate 0.6s ease;
}

.result-question {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ccc;
  animation: pulse 1.4s ease infinite;
}

.equation-display {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  min-height: 36px;
  margin: 8px 0;
}

.equation-display .eq-correct {
  color: var(--correct);
}

/* --- Equation Display --- */
.equation {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  animation: fade-in 0.3s ease;
}

.equation .operator {
  color: #999;
  font-size: 1.8rem;
}

.equation .result {
  color: var(--btn-primary);
}

.equation .result--hidden {
  color: #ccc;
}

/* --- Build Counter --- */
.build-counter {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dark);
  opacity: 0.7;
  margin-top: 8px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .game-title {
    font-size: 1.1rem;
  }

  .game-prompt {
    font-size: 1.5rem;
  }

  .game-prompt .target-number {
    font-size: 2rem;
  }

  .celebration-title {
    font-size: 1.8rem;
  }

  .answer-row {
    gap: 10px;
  }

  .equation {
    font-size: 1.6rem;
  }
}

@media (max-width: 600px) {
  .op-stage {
    gap: 12px;
    min-height: 200px;
  }

  .op-stage .operator {
    font-size: 1.8rem;
    padding-bottom: 24px;
  }

  .result-slot {
    min-width: 70px;
    min-height: 70px;
    margin-bottom: 24px;
  }

  .result-question {
    font-size: 2rem;
  }

  .equation-display {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .game-header {
    padding: 8px 12px;
  }

  .game-area {
    padding: 12px;
  }

  .nb-btn--large {
    min-width: 72px;
    min-height: 72px;
    font-size: 1.8rem;
  }
}
