/* === Target Number Game Styles === */

/* Target display */
.target-section {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.target-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.target-value {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Number tiles */
.number-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem 0;
  min-height: 64px;
}

.number-tile {
  width: 64px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
  color: var(--color-text);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.8);
  font-variant-numeric: tabular-nums;
}

.number-tile:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.number-tile:active { transform: scale(0.95); }

.number-tile.selected {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(232, 150, 12, 0.3);
}

/* Operations */
.operations {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem 0;
}

.op-btn {
  width: 56px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--color-primary);
  color: #fff;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.op-btn:hover { background: var(--color-primary-light); }
.op-btn:active { transform: scale(0.95); }

.op-btn.selected {
  background: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(232, 150, 12, 0.3);
}

/* Step history */
.step-history {
  padding: 0.75rem 0;
  min-height: 48px;
}

.step {
  padding: 0.3rem 0;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.step-num {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.step-placeholder {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem 0;
}

/* Action buttons row */
.actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.75rem 0;
}

.actions .btn { flex: 1; max-width: 150px; }

.completed-msg {
  text-align: center;
  color: var(--color-text-muted);
  padding: 1rem 0;
  font-size: 1.1rem;
}

/* Victory overlay */
.victory-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.victory-overlay.show { display: flex; }

.victory-card {
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  width: 100%;
  padding: 2rem 1.5rem;
  text-align: center;
}

.victory-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.victory-overlay.won .victory-title { color: var(--color-success); }

.victory-stars {
  font-size: 2rem;
  margin: 0.5rem 0;
  min-height: 2.5rem;
}

.victory-detail {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.victory-difficulty {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
}

.difficulty-1 { color: #10b981; background: rgba(16, 185, 129, 0.12); }
.difficulty-2 { color: var(--color-accent); background: rgba(232, 150, 12, 0.12); }
.difficulty-3 { color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.difficulty-4 { color: #8b5cf6; background: rgba(139, 92, 246, 0.12); }

.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.victory-actions .btn { width: 100%; }

/* Next puzzle countdown */
.next-puzzle {
  text-align: center;
  padding: 0.75rem 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.next-puzzle-time {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Game timer */
.game-timer {
  text-align: center;
  padding: 0.25rem 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.timer-icon { font-size: 1.1rem; }

.game-timer.warning .timer-value { color: var(--color-accent); }

.game-timer.expired .timer-value {
  color: var(--color-error);
  opacity: 0.6;
}

/* Settings modal */
.settings-list { padding: 0.25rem 0; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  cursor: pointer;
  user-select: none;
}

.setting-label {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Responsive fine-tuning */
@media (max-width: 380px) {
  .number-tile {
    width: 54px;
    height: 48px;
    font-size: 1.15rem;
  }

  .op-btn {
    width: 48px;
    height: 42px;
    font-size: 1.2rem;
  }

  .target-value { font-size: 2.8rem; }
}
